Closest To Zero

milwphil

Board Regular
Joined
Aug 1, 2010
Messages
120
Is there a formula that I can use to determine if a cell is closer to zero than another cell (comparing the two) and then enter either "Yes" or "No"

For example: The data being compared is in Column A and B. If Column B is closer to zero than "No", if Column A is closer to Zero than "Yes."

Using less than doesn't work because of the negative numbers.

Column
A | B | C
-1 | -2 | Yes
-5 | -2 | No
2 | 1 | No
1 | 2 | Yes

Thanks in advance!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
You can make use of the Absolute Value (ABS) function:
Code:
=IF(ABS(A1) < ABS(B1),"Yes","No")
 
Upvote 0
Is there a formula that I can use to determine if a cell is closer to zero than another cell (comparing the two) and then enter either "Yes" or "No"

For example: The data being compared is in Column A and B. If Column B is closer to zero than "No", if Column A is closer to Zero than "Yes."

Using less than doesn't work because of the negative numbers.

Column
A | B | C
-1 | -2 | Yes
-5 | -2 | No
2 | 1 | No
1 | 2 | Yes

Thanks in advance!
Try...

=IF(A2 = B2, "Both", IF(ABS(A2) < ABS(B2), "Yes", "No"))
 
Upvote 0

Forum statistics

Threads
1,224,525
Messages
6,179,314
Members
452,905
Latest member
deadwings

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top