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

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
Asked:
sukhoi35
  • 2
  • 2
1 Solution
 
Wayne Taylor (webtubbs)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
 
sukhoi35Author 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
 
Wayne Taylor (webtubbs)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
 
sukhoi35Author 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.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now