View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.misc
MeatLightning MeatLightning is offline
external usenet poster
 
Posts: 27
Default Identify condition using multiple criteria WITHOUT sumproduct?

Yeah, it's a tricky one...

I have what I consider "raw" data on the left... using the example data:

ID | LINE | VALUE | TYPE |
01 | 1 | $1 | YELLOW|
01 | 3 | $5 | RED |
01 | 2 | $3 | BLUE |
04 | 2 | $5 | RED |
04 | 1 | $1 | BLUE |

a couple of columns to the right I have "helper" columns that consolidate
the data for me... for example:

UNIQUE ID | IS BLUE | IS YELLOW | TOTAL |
01 | TRUE | TRUE | $9 |
- | - | - | - |
- | - | - | - |
04 | TRUE | FALSE | $6 |
- | - | - | - |

I calculate the "UNIQUE ID" column with this formula
=IF(COUNTIF($A$1:A1,A1)=1,A1,0)
(where "A" is the "ID" column. Note the "$" locks to accommodate a copy &
paste down)

I calculate the "TOTAL" column with this:
=IF(Q1="-",0,SUMIF(Q:Q,Q1,C:C))
(where "Q" is the "UNIQUE ID" column)

What I'm stuck on is how to calculate the "IS BLUE" & "IS YELLOW" columns...

"IS BLUE" column should be "TRUE" when the UNIQUE ID is not "-" AND any of
the rows with a matching "ID" have "BLUE" in the "TYPE" column.