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

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Try:
=IF(AND(A1<>0,B1<>0),MAX(A1,B1)/MIN(A1,B1),"")
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

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