lundi 7 décembre 2015

IF Statement with Multiple Criteria

I am trying to use if statements with 2 criteria to determine if a Variation Level value of 0) is NEW or EXISTING based on whether or not there is data in the "Prev" column for that variation's parts (Level values 1-4). Each variation may contain 1 or more parts, and I am unsure of how to tell Excel how to highlight only the New Variation Rows, based on the below logical question and example.

Column A Header= EXISTING/NEW
Column B Header= Group
Column C Header= Div
Column D Header= Rev
Column E Header= Level
Column F Header= Part Number
Column G Header= Quantity
Column H Header= Prev

enter image description here

The question I want to answer is: If column E (Level)="group code" or "variation" look to see if there is data in column Prev. If there are any blank cells in column H Prev [not at the Variation or Group Code level], then this is a NEW variation. If all the parts in column F have a value greater than 0 in column Prev, then that variation is EXISTING.and all the parts in that variation cells in Column H (Prev) contains any value >0 then [in row containing Variation] "Existing","New". ; AND when the next "Group Code" or "Variation" is reached in column E (Level)

My current If statement looks like this:

=IF(E2="Group Code","Group Code",IF(AND(ISBLANK(H3),(E2)="Variation"),"NEW","EXISTING"))

This is my data:

EXISTING / NEW  Group   Div Rev Level   Part Number Quantity Prev
Group Code  8200            Group Code  1234    0   
EXISTING    8200    1   AA  Variation       1111-01-AA  0   
EXISTING    8200    1   AA  1               11111-11111 1   1986
EXISTING    8200    1   AA  1               12121-21212 1   1989
EXISTING    8200    1   AA  1               23232-31313 1   1986
NEW 8200    1   AB  Variation       2222-01-AA  0   
EXISTING    8200    1   AA  1               11111-11111 1   
EXISTING    8200    1   AA  1               12121-21212 1   
EXISTING    8200    1   AA  1               23232-31313 1   
EXISTING    8200    1   AC  Variation       3333-01-AA  0   
EXISTING    8200    1   AA  1               11111-11111 1   1985
EXISTING    8200    1   AA  1               12121-21212 1    
EXISTING    8200    1   AA  1               23232-31313 1   2000
EXISTING    8200    1   AA  1               11111-11111 1   1532
EXISTING    8200    1   AA  1               12121-21212 1    
EXISTING    8200    1   AA  1               23232-31313 1   
EXISTING    8200    1   AA  1               11111-11111 1   1986
EXISTING    8200    1   AA  1               12121-21212 1   1989
EXISTING    8200    1   AA  1               23232-31313 1   4512
EXISTING    8200    1   AA  1               11111-11111 1   1986
EXISTING    8200    1   AA  1               12121-21212 1   1989
EXISTING    8200    1   AA  1               23232-31313 1   
EXISTING    8200    1   AC  Variation       3333-01-AA  0   
EXISTING    8200    1   AA  1               11111-11111 1   4135
EXISTING    8200    1   AA  1               12121-21212 1   4987
EXISTING    8200    1   AA  1               23232-31313 1   
EXISTING    8200    1   AA  1               11111-11111 1   3587

Aucun commentaire:

Enregistrer un commentaire