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
 

Some videos you may like

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Joe4

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

Watch MrExcel Video

Forum statistics

Threads
1,119,002
Messages
5,575,483
Members
412,668
Latest member
Lukep22
Top