Forum Discussion

fishdude's avatar
fishdude
Copper Contributor
Aug 19, 2020

Combining multiple if(functions in one cell

Hi! 

So this one is a bit tricky. I'm trying to connect these three separate formulas into one cell: 
I got one formula which is - if this cell is salmon , and there is 1+ of them, choose this cell with input length cm to calculate weight, if not pick the cell with height (n12) and use this formula.

=IF(I12="salmon",IF(M12>0,SUM((((M12/100)^3)*10)*0.9711),SUM(0.004*N12^2.535))) - Works

then I got the same one for trout but without the height formula
=IF(I12="trout",IF(M12>0,SUM((((M12/100)^3)*10)*0.105) - Works

Now Im having trouble combining them; (last attempt)

IF(I11="trout",IF(M11>0,SUM((((M11/100^3)*10)*1.049)),IF(I11="salmon",IF(M11>0,SUM((((M11/100)^3)*10)*0.9711),SUM(0.004*N11^2.535)))))

Anyone got tips?

2 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    fishdude 

    As variant

    =IF(I12="trout",
       IF(M12>0,
         ((M12/100)^3)*10*0.105,
         0
       ),
     IF(I12="salmon",
       IF(M12>0,
         ((M12/100)^3)*10*0.9711,
          0.004*N12^2.535
       ),
     0))
  • fishdude's avatar
    fishdude
    Copper Contributor

    fishdude 

    The logic In short: 
    IF A(salmon) and B(1), and either C(length) or D(height); use E formula*C if C present or F formula* D if D present. But if A(trout) and B(1), and C (length) use G formula*C



Resources