I need to count occurrences of one of five text strings (e.g. "NICU") in one column of a row OR'ed with the existence of a number one ("1") in either of five other columns. I don't want to miss any, but I don't want to double count anything either!
I have tried with code like this, but it only goes part way and then appears to run up against a nesting limit:
=IF(OR(COUNTIF(JAN!$D2,"NICU"),COUNTIF(JAN!$G2,1)),1,IF(OR(COUNTIF(JAN!$D2,"NICU"),COUNTIF(JAN!$H2,1)),1,IF(OR(COUNTIF(JAN!$D2,"NICU"),COUNTIF(JAN!$I2,1)),1,IF(OR(COUNTIF(JAN!$D2,"NICU"),COUNTIF(JAN!$J2,1)),1,IF(OR(COUNTIF(JAN!$D2,"NICU"),COUNTIF(JAN!$K2,1)),1,IF(OR(COUNTIF(JAN!$D2,"3 MONTI"),COUNTIF(JAN!$G2,1)),1,))))))
The formula gets to be too long after this anyway!
So my question is--is there not an array solution to this?
I have tried with code like this, but it only goes part way and then appears to run up against a nesting limit:
=IF(OR(COUNTIF(JAN!$D2,"NICU"),COUNTIF(JAN!$G2,1)),1,IF(OR(COUNTIF(JAN!$D2,"NICU"),COUNTIF(JAN!$H2,1)),1,IF(OR(COUNTIF(JAN!$D2,"NICU"),COUNTIF(JAN!$I2,1)),1,IF(OR(COUNTIF(JAN!$D2,"NICU"),COUNTIF(JAN!$J2,1)),1,IF(OR(COUNTIF(JAN!$D2,"NICU"),COUNTIF(JAN!$K2,1)),1,IF(OR(COUNTIF(JAN!$D2,"3 MONTI"),COUNTIF(JAN!$G2,1)),1,))))))
The formula gets to be too long after this anyway!
So my question is--is there not an array solution to this?