Search code examples
if-statementgoogle-apps-scriptgoogle-sheetsgoogle-sheets-formulacustom-function

How to countif or sumif in google sheet with background color count based on other cell value


I have google sheet, I'm able to count same background colored column in the sheet with help of this addon "https://chrome.google.com/webstore/detail/custom-count-and-sum/njiklelndjpdbdngfkdgeijcpfabfgkb"

Now I want to add condition here, I just want to count background color only if B column empty. How can I do that?

This is what now I have

enter image description here

And this is what I want

enter image description here


Solution

  • to count background color only if B column empty

    you can wrap it into IF fx:

    =IF(COUNTA(B2:B)=0, COUNTBACKGROUNDCOLOR("A2:A9", "A2", A2:A9), "pending")
    

    0

    0