RT said:
Joe, I didn't have any blanks in P2
2000,
but the last 40 cells in J2:J2000 were blank. [....]
Would it be possible to tweak my formula so that
any blanks in J2:J2000 are not "counted" as zero?
See Bernard's solution.
You might want to change the relative references (e.g. J2:J2000) to absolute
references ($J$2:$J$2000). But relative references should suffice unless you
are copying the formula and want to preserve the references to those specific
ranges.
But I continue to suspect that you want SEARCH("F",P2
2000). If that's the
case, you should not need the ISTEXT argument in Bernard's formula. It
doesn't hurt; it's just be redundant.
Also, if you are sure that J2:J2000 will only contain numbers or null
strings or they will be empty, the following should suffice (again, using
absolute references if you wish):
=SUMPRODUCT((J2:J2000<>"")*(J2:J2000>=0)*ISNUMBER(SEARCH("F",P2
2000)))
or if you prefer:
=SUMPRODUCT(--(J2:J2000<>""), --(J2:J2000>=0),
--ISNUMBER(SEARCH("F",P2
2000)))
----- original message -----
RT said:
Joe, I didn't have any blanks in P2
2000, but the last 40 cells in J2:J2000
were blank. Changing them to "-1" led me to the correct result. I update
this data everyday, and there is always less than 2000 rows of data, but the
total varies. I would prefer to not have to verify that there are no blanks
between J2:J2000 every time that I update (P2
2000 contains a vlookup
formula, and is never changed). Would it be possible to tweak my formula so
that any blanks in J2:J2000 are not "counted" as zero?
Here's an example of my data:
(Col J) (Col P)
DAYS Responsible Group
462 P
371 #N/A
371 #N/A
370 #N/A
369 #N/A
358 #N/A
354 #N/A
349 #N/A
346 #N/A
336 #N/A
336 #N/A
336 #N/A
336 #N/A
336 #N/A
335 F
328 F
#N/A
#N/A