Forum Discussion

Greg Bonaparte's avatar
Greg Bonaparte
Iron Contributor
Oct 27, 2018

What function should I use>

I would like a cell to calculate a formula in a cell only if certain criteria is met in a cell range. Otherwise I want the same cell to remain blank. EXAMPLE:

 

SUM "=$P30/$Q30" INSIDE OF CELL R30
IF "AC30>AB30 & AE30>AD30 & AG30>AF30 & AI30>AH30 & AK30>AJ30 & AM30>AL30 & F30>E30 & G30>F30 & H30>G30 & H30>I30"

OTHERWISE LEAVE CELL R30 BLANK

1 Reply

  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    Hi Greg,

     

    Please update the formula in cell R30 as follows:

    =IF(AND(AC30>AB30, AE30>AD30, AG30>AF30, AI30>AH30, AK30>AJ30, AM30>AL30, F30>E30, G30>F30, H30>G30, H30>I30),$P30/$Q30,"")

     

    When all the below logical tests are true, the formula will divide the value of cell P30 on the value of cell Q30, otherwise, it will return a blank string.

    AC30>AB30, AE30>AD30, AG30>AF30, AI30>AH30, AK30>AJ30, AM30>AL30, F30>E30, G30>F30, H30>G30, H30>I30

     

    If you want at least one of them to be true in order to calculate, please use OR instead of AND

    =IF(OR(AC30>AB30, AE30>AD30, AG30>AF30, AI30>AH30, AK30>AJ30, AM30>AL30, F30>E30, G30>F30, H30>G30, H30>I30),$P30/$Q30,"")

     

    Hope that helps

Resources