Cannot find CountIfs combination to recognize a blank cell

HMSTPI

New Member
Joined
Jul 31, 2017
Messages
18
I have a list of rules in text form that perform various integrity check on data in a table. Here are just 2 of the currently 13 rules in the list (along with the hidden field that turn the field name into valid table cell refs):

2021-08-30_17-16-41.jpg


The relevant columns/fields in the Trxns table for a record giving me fits are:
2021-08-30_17-11-53.jpg

The check formula, in the [Edit_Code] column, uses INDIRECT to execute the rules on each row of table and return the text applicable on each row that fails a test. Assuming the above tests are on rows 2 & 3 the formula is:
=IFS(COUNTIFS(INDIRECT($AV$2),$N$2,INDIRECT($AX$2),$P$2&$Q$2,INDIRECT($AZ$2),$S$2)=1,$K$2,​
COUNTIFS(INDIRECT($AV$3),$N$3,INDIRECT($AX$3),$P$3&$Q$3,INDIRECT($AZ$3),$S$3)=1,$K$3,​
TRUE,"ok")​

I have narrowed it down to the highlighted condition as being the problem -- but no matter how it is set, it keeps resulting in "ok" when it should result in "Disp'd RJCD Sec ID". I have tried:
SecIDOvrd < "0"​
SecIDOvrd = 0​
SecIDOvrd = ""​

What am I missing? I think I have always made do by restructuring the formula to countif length of the field = 0 -- but in a table of 13 integrity checks -- all of which are expected to work in the same manner to make it easy to add and remove checks as things change.... I don't have the flexibility here to do that. Something OUGHT to WORK here!

Thanks for any help!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi,

The error is within concatenating P$3&$Q$3. The combination will not evaluate to the criterium you want to use (ic is the cell blank) because you've forgot to take the text identifier of the cell into account.
See this example where Range (A1:A2) holds 2 true blanks, Range (B1:B2) holds 2 created blanks by formula:
Book1
ABCDEFGH
1 00=""
2 11
Sheet1
Cell Formulas
RangeFormula
D1:E1D1=COUNTIFS(A1,$G$1&$H$1)
D2:E2D2=COUNTIFS(A2,$G$2&$H$2)
B1:B2B1=IF(A1=0,"",0)


If you evaluate the formula in E1 you'll see Excel has added the text identifiers.
1630403534834.png


How to solve, just delete P3 and Q3 or in my example G2 and H2 so they will be blank then countifs will treat the blank cells as criteria, like this
1630403735598.png

From a lack of more info i'm unsure if this solution will cause problems somewhere else in your sheet.

Hope this helps.
 
Upvote 0
Solution
Well -- I would have NEVER have thought that just leaving both the qualifier and the criteria blank would work, but it certainly did! Thanks for the quick reply!
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,597
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top