• Status: Solved
• Priority: High
• Security: Public
• Views: 34

# Find max absolute of two numbers and retain it's original sign.

Experts,
I am trying to find the absolute highest value of two columns and store it in the third column. The only catch here is the value stored in the third column should retain it's original sign.
For example, for the values -0.1430000060 and -0.1410000030 when I run =MAX(ABS(A1:B1)), it returns 0.1430000060 without the - sign. Any suggestions?
Sample.xlsx
0
sukhoi35
• 2
• 2
1 Solution

Commented:
Are the numbers always negative as in your example? If so, you're not looking for the highest, but the lowest and you can just use the MIN function.

=MIN(A1:B1)
0

Author Commented:
The numbers can be either positive or negative. Sorry, the sample I chose contains only negative, it is a pretty huge file running into several hundred thousands of rows.
0

Commented:
OK, as you're only comparing 2 columns, you can use a simple IF statement to compare the absolute values...

=IF(ABS(A1)>ABS(B1), A1, B1)
0

Author Commented:
Thank you, Wayne!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.