Search code examples
if-statementgoogle-sheetsgoogle-sheets-formula

Google Sheets Formula help: IF reference cell is BLANK, then cell is BLANK


OK the solution should be simple... like =IF(AG3 = "", "") but I am unable to add the clause to my current formula as seen below: Any suggestions?

=IF(

IF(AF3 <> "y",

SUM(IFNA(VLOOKUP($AG3, RICS_TimeClocks!Q$3:U, 4, 0), 0), 
     IFNA(VLOOKUP($AG3, RICS_TimeClocks!V$3:Z, 4, 0), 0))

,"0")

 = "0", "", SUM(IFNA(VLOOKUP($AG3, RICS_TimeClocks!Q$3:U, 4, 0), 0), 
     IFNA(VLOOKUP($AG3, RICS_TimeClocks!V$3:Z, 4, 0), 0)))

Solution

  • Let's say your current formula is "FORMULA", you would have to do the following:

    =IF(AG3="",,FORMULA)
    

    Now replace FORMULA with your actual formula and you get

    =IF(AG3="",,IF(
    
    IF(AF3 <> "y",
    
    SUM(IFNA(VLOOKUP($AG3, RICS_TimeClocks!Q$3:U, 4, 0), 0), 
         IFNA(VLOOKUP($AG3, RICS_TimeClocks!V$3:Z, 4, 0), 0))
    
    ,"0")
    
     = "0", "", SUM(IFNA(VLOOKUP($AG3, RICS_TimeClocks!Q$3:U, 4, 0), 0), 
         IFNA(VLOOKUP($AG3, RICS_TimeClocks!V$3:Z, 4, 0), 0))))