Avatar of Andreamary
Andreamary
 asked on

Counting # of WOs in Excel meeting specific criteria

I need a formula for Column F of attached sample spreadsheet based on the following conditions:

If following conditions are met:
Col A is not blank, and the number is unique (format of number is always "yyyy-#######")
Col B does not contain the text string "amd" or "AMD"
Col D is not blank
Col E is not blank, and does not contain "N/A"

Then:
Column F (COUNT_WO) = 1

If the above conditions are not met, then:
Column F (COUNT_WO) = 0

If error, then:
Column F (COUNT_WO) = blank

Thanks!
Andrea
EE_Summary_Count_WOs.xlsx
Microsoft Excel

Avatar of undefined
Last Comment
Andreamary

8/22/2022 - Mon
NBVC

Does this work?

=IFERROR(IF(AND(A2<>"",COUNTIF($A$2:$A$13,A2)=1,ISERROR(SEARCH("amd",B2)),D2<>"",E2<>"",ISERROR(SEARCH("N/A",E2))),1,0),"")
ASKER CERTIFIED SOLUTION
Glenn Ray

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Andreamary

ASKER
Hi Glenn,

Yes, you're right - only the first occurrence of the WO# is considered unique. Your formula works perfectly...thank you!

NBVC - your formula didn't work correctly in all instances but thanks for offering a solution.

Cheers,
Andrea
Rob Henson

Where there are multiple occurrences of an item in an ID/Reference field I often find it is easier to summarise the data in a Pivot Table. The pivot then gives only row per ID.

If you don't have numbers to summarise, you can use one of the text fields as a Value field and it will apply a count to that field.

You can then use Filters on the Pivot to include/exclude certain values.
Your help has saved me hundreds of hours of internet surfing.
fblack61
Andreamary

ASKER
Thanks, Rob, for the tip....

Andrea