Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count cells like "Pending*" and date within quarter help!

Status
Not open for further replies.

Drivium

Technical User
Oct 6, 2011
46
0
0
US
I have a spreadsheet with 4 columns representing quarters (Q1-Q4). For each quarter there are mixed dates and text in the cells. For cells with "Pending*" and dates that fall within that quarter, I need to count the occurences. This number represents the number of failures for that well, for that quarter. I've managed to use conditional formatting to highlight these cells, but can't figure out how to make the same logic work to count the cells.

One catch is, the "Pending*" piece has to count the number of cells where the previous quarter is different. In other words, for quarter 3, if well RBT691 has a pending date, but quarter 2 has the same pending date, this means that the failure occured in quarter 2 and will not be counted in quarter 3. I managed to make one piece that accomlishes this as a count:
{=SUMPRODUCT(IF(ISNUMBER(SEARCH("Pending*",I$17:I$134)),IF(NOT(ISNUMBER(SEARCH("Pending*",F$17:F$134))),1,0)))}

The other piece that counts the date within quarter for CURRENT YEAR to highlight in conditional formatting is:
Q1
=SUM(IF(AND(MONTH($I$17)<4,YEAR($I$17)=YEAR(TODAY())),1,0))
Q2
=SUM(IF(AND(MONTH($L$17)>3,YEAR($L$17)=YEAR(TODAY())),1,0))
Q3
=SUM(IF(AND(MONTH($O$17)>6,YEAR($O$17)=YEAR(TODAY())),1,0))
Q4
=SUM(IF(AND(MONTH($R$17)>9,YEAR($R$17)=YEAR(TODAY())),1,0))

But again, this piece is used in conditional formatting, so it has the option to apply this to a range of cells, even though the Month and Year function forces you to choose a single cell...not sure how to apply this to a range to achieve a count outside of conditional formatting...

Some how need to make each of these pieces work (or come up with a new way) to count the total number of cells for that specific quarter that meet this criteria. For example: need to count all of the cells within Q1 where dates are between 1/1/2011-3/31/2011 & where like "Pending*". The cells I intend to place this new formula in are at the top of each quarter column. Q1=J11, Q2=M11, Q3=P11,Q4=S11

Tricky!! Please help!

 


Please post your sample data directly here, if you want immediate help, as many of us are restricted from downloading data by our company.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top