Multiple IF statement

didactics

New Member
Joined
Oct 27, 2005
Messages
16
Hello all:
Maybe someone can help with this problem!
Cell A1 and B1 contain #'s.
In Cell C1 Im looking to divide the highest value by the lowest value between the two cells but only if there is a value in cell A1.

Here's the formula I tried to use.

Code:
=IF((AND(a1,a1<b1)),a1/b1,b1/a1)


Different explanation... if (there's a value in cell A1, (and if the value in cell A1 is < value in cell B1))if true divide A1/B1, if false divide B1/A1.

Only problem with this is.... it's not recognizing the 1st value. I don't have anything in cell A1 and I'm still getting a result in cell C1
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
63,243
Office Version
  1. 365
Platform
  1. Windows
Try:
=IF(AND(A1<>0,B1<>0),MAX(A1,B1)/MIN(A1,B1),"")
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,498
Messages
5,832,060
Members
430,109
Latest member
tinezi

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
Top