# Multiple IF statement

#### didactics

##### New Member
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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Try:
=IF(AND(A1<>0,B1<>0),MAX(A1,B1)/MIN(A1,B1),"")

Replies
4
Views
111
Replies
20
Views
487
Replies
8
Views
669
Replies
5
Views
187
Replies
7
Views
425

1,211,877
Messages
6,104,517
Members
447,913
Latest member
kowboy_sparrow

### 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.

### Which adblocker are you using?

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

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