Home > Software design >  IFS not working when cell is blank in Google Sheet
IFS not working when cell is blank in Google Sheet

Time:10-07

I have the following data in the Google Sheet

enter image description here

The column B will have the value from Q1, Q2, Q3, Q4

I want to calculate the number of data with each Quarter value, so I used the following formula in a cell

=IFERROR(COUNTIF(Initiatives!B13:B, "Q2", Initiatives!A13:A))

enter image description here

But it shows blank when there is no count

In another cell, I have to print 5 when the count is 0, so I put

=IFS(ISBLANK(Calculator!E10), 5)

But it prints nothing, whereas the ISBLANK() check gives True

How can I print 5 when the cell is blank or 0.

Example Sheet: https://docs.google.com/spreadsheets/d/12VCFZTLjdxcY8SoP-jkoIB7lZiE66RmnuAFWzXHgdVg/edit?usp=sharing

CodePudding user response:

First - you have an error in the formulas H5:K5 - COUNTIF function must have two arguments, perhaps:

=IFERROR(COUNTIF(B3:B, "Q1"))

second - cells H15:K15 background color is the same as the font color - you will not see any results,

third - the function IFS under the condition ISBLANK (H5) will return zero, change to 1 if necessary.

CodePudding user response:

Why do you want to test if blank? Just try in H5

=COUNTIF($B$3:$B, H3 )

and copy / paste to the right for Q2, Q3, Q4.

In H15

=MIN(5,H5 1)
  • Related