Прескочи на основното съдържание

Как да промените отрицателните числа на положителни в Excel?

Автор: Техническа поддръжка Последна промяна: 2023-12-18

Когато обработвате операции в Excel, понякога може да се наложи да промените отрицателните числа на положителните числа или обратно. Има ли някакви бързи трикове, които можете да приложите за промяна на отрицателните числа в положителни? Тази статия ще ви представи следните трикове за лесно преобразуване на всички отрицателни числа в положителни или обратно.

Променете отрицателните на положителни числа със специалната функция Paste

Променете лесно отрицателните числа на положителни с Kutools за Excel

Използване на VBA код за преобразуване на всички отрицателни числа от диапазон в положителни


Променете отрицателните на положителни числа със специалната функция Paste

Можете да промените отрицателните числа на положителни числа със следните стъпки:

1. Въведете номер -1 в празна клетка, след това изберете тази клетка и натиснете Ctrl + C ключове за копиране.

2. Изберете всички отрицателни числа в диапазона, щракнете с десния бутон и изберете Поставяне на специални ... от контекстното меню. Вижте екранна снимка:

Забележки:
(1) Холдинг Ctrl клавиш, можете да изберете всички отрицателни числа, като ги щракнете едно по едно;
(2) Ако имате инсталиран Kutools за Excel, можете да го приложите Изберете Специални клетки функция за бързо избиране на всички отрицателни числа. Имате безплатен пробен период!

3. И а Залепете специално ще се покаже диалогов прозорец, изберете Всички опция от Пастаизберете Умножете опция от операция, Щракнете върху OK. Вижте екранна снимка:

4. Всички избрани отрицателни числа ще бъдат преобразувани в положителни числа. Изтрийте числото -1, както ви е необходимо. Вижте екранна снимка:

Лесно променяйте отрицателните числа на положителни в посочения диапазон в Excel

В сравнение с премахването на отрицателния знак от клетки една по една ръчно, Kutools за Excel Промяна на знака на стойностите функцията предоставя изключително лесен начин за бърза промяна на всички отрицателни числа на положителни в селекцията. Вземете 30-дневен пълнофункционален безплатен пробен период сега!

рекламата преобразува отрицателна в положителна

Kutools за Excel - Заредете Excel с над 300 основни инструмента. Насладете се на пълнофункционален 30-дневен БЕЗПЛАТЕН пробен период без кредитна карта! Вземи Го Сега


Бързо и лесно променете отрицателните числа на положителни с Kutools за Excel

Повечето потребители на Excel не искат да използват VBA код, има ли бързи трикове за промяна на отрицателните числа в положителни? Kutools за Excel може да ви помогне лесно и удобно да постигнете това.

Kutools за Excel - Заредете Excel с над 300 основни инструмента. Насладете се на пълнофункционален 30-дневен БЕЗПЛАТЕН пробен период без кредитна карта! Вземи Го Сега

1. Изберете диапазон, включващ отрицателните числа, които искате да промените, и щракнете Kutools > съдържание > Промяна на знака на стойностите.

2. Проверка Променете всички отрицателни стойности на положителни под операция, и кликнете Ok. Вижте екранна снимка:

Сега ще видите как всички отрицателни числа се променят на положителни числа, както е показано по-долу:

Забележка: С тази Промяна на знака на стойностите можете също така да коригирате отрицателните знаци в края, да промените всички положителни числа на отрицателни, да обърнете знака на всички стойности и да промените всички отрицателни стойности на нула. Имате безплатен пробен период!

(1) Бързо променете всички положителни стойности на отрицателни в посочения диапазон:

(2) Лесно обърнете знака на всички стойности в посочения диапазон:

(3) Променете лесно всички отрицателни стойности на нула в посочения диапазон:

(4) Лесно коригиране на завършващите отрицателни знаци в посочения диапазон:

тип: За да използвате тази функция, трябва да инсталирате Kutools за Excel първо, моля щракнете, за да изтеглите и имате 30-дневен безплатен пробен период сега.

Използване на VBA код за преобразуване на всички отрицателни числа от диапазон в положителни

Като професионалист в Excel можете също така да стартирате кода на VBA, за да промените отрицателните числа на положителни числа.

1. Натиснете клавишите Alt + F11, за да отворите прозореца на Microsoft Visual Basic за приложения.

2. Ще се покаже нов прозорец. Кликнете Поставете > Модули, след това въведете следните кодове в модула:

Sub Positive
Dim Cel As Range
For Each Cel In Selection
If IsNumeric(Cel.Value) Then
Cel.Value = Abs(Cel.Value)
End If
Next Cel
End Sub

3, След това кликнете бягане бутон или натиснете F5 ключ за стартиране на приложението и всички отрицателни числа ще бъдат променени на положителни числа. Вижте екранна снимка:


Демонстрация: Променете отрицателните числа на положителни или обратно с Kutools за Excel


Kutools за Excel: Над 300 удобни инструмента на една ръка разстояние! Започнете своя 30-дневен безплатен пробен период без ограничения на функциите днес. Свали сега!
Comments (31)
Rated 4.5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
=sqrt((numbers)^2)
This comment was minimized by the moderator on the site
Hi Kevin Alexander,
The SQRT function is a good way. However, if you want to convert a negative number to positive by excel formula/function, you can use the ABS function directly, =ABS(your_negative_number). For example, =ABS(-5) will return 5.
This comment was minimized by the moderator on the site
I chose a simpler solution, no formulas needed. First, to preserve the original data in case I goofed up, I copied the raw CMM measurement data in Worksheet 1 to Worksheet 2. Next, In Worksheet 2, I selected the multiple disconnected blocks of cells which had some negative numbers I wanted to convert to positive numbers. Then, I simply used the “replace” function to replace the minus sign with … nothing! It worked perfectly, and was clean; no formulas, no conditional formatting, and the raw unaltered data remained on Worksheet 1 as my backup resource. Applying a formula is not always the answer. I love using Excel to do data logging, tracking, analysis, and to answer so many math questions, both at work and personally. At work, I measure parts, and the machine measures distances to the left as negative numbers, and not just a positive number distance. Other measurements, though, are at a position of being on a datum X or Y, at zero. Those measurements will be off zero in the positive or negative direction, and I need hose occasional negative numbers to remain negative. That meant I had to select a partial column here, another there, and skip ones that measured around a zero target, then apply that “negative sign removal) to only those measurements that were negatives, but did not have zero as the target dimension. It is probably confusing until actually seeing the spreadsheet I was fixing, but the method I chose worked perfectly, and had no formula involved, just a clean minus-sign removal done as a “replace” edit. Thank you, Joel
This comment was minimized by the moderator on the site
Thank you so much!
This comment was minimized by the moderator on the site
use this formula (A1 is a cell reference in which you want to convert) =max(A1,-A1) What this formula does is to choose the highest number, and positive will normally be the highest number.
This comment was minimized by the moderator on the site
Taimoor, Your solution requires adding a column of formulas. The easiest way is to use "find and replace", as I explained here on 4/20/16. Enter a dash in the first line, nothing in the second, and replace as many of them as you want ("find next" or "replace all"). Not "complexed" at all. Your method creates clutter on the spreadsheet with a new column of formulas that requires the first column of negative numbers to remain, although it is now just a sub-component of the formulas column. Then, if you want to clean up the spreadsheet, you would have to hide that first column of negative numbers. Messy. No thank you. You say other people's methods are "complexed", but yours is not, IMHO, much, if any, of an improvement.
This comment was minimized by the moderator on the site
"Formulas? We don' need no ... " Click on Find and Replace. Enter a dash in the "Find What" section. Leave the "Replace With" section blank. Click "Replace All" and BAM! Negativity" gone. If you want to play it safe, and aren't sure about whether or not you will muck up your spreadsheet, copy Sheet 1 to Sheet 2, then perform the Find and Replace action with Sheet 2. If you like it, copy what you want and paste it back into Sheet 1. Safe as can be!
This comment was minimized by the moderator on the site
Click on that Negative Number. Right Click & go on Format Cell & click on 1234.
This comment was minimized by the moderator on the site
Sachin, when you go to "Format Cell, and do as you suggested, that does not change the value of the number, it will only change the format, the color. And you left out a couple steps: 1. what tab to click on (number?), and 2. what category in that tab do you choose, then 3. which style option do you select (which still will not change the VALUE of the number, only the appearance (negative numbers showing in red, for example).
This comment was minimized by the moderator on the site
It's so simple. Don't know why it's been explained in such a complexed manner. Suppose you have a column A with following values: Cell A: A2= -4000 A3= -5000 A4= -8000 Apply the formula in cell B2 =A2*(-1) And drag it down till the last value of column A. Done!
This comment was minimized by the moderator on the site
Just did the copy/paste -1 onto highlighted positive numbers and puff, like magic my job is done here. Big time saver big help
This comment was minimized by the moderator on the site
I've found highlighting the column hitting ctrl F, then replacing - with nothing will remove the -. Its easy
This comment was minimized by the moderator on the site
It is so simple if you multiply -1 with the value or column and drag the formula :)
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations