Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Counting # of WOs in Excel meeting specific criteria

Posted on 2016-10-03
Medium Priority
51 Views
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
0
Question by:Andreamary
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 23

Expert Comment

ID: 41827024
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),"")
0

LVL 27

Accepted Solution

Glenn Ray earned 2000 total points
ID: 41827041
It appears that if a WO# appears more than once, only the first occurrence is considered unique.  If that is true then this formula will return the results you are expecting:

F2:  =IF(AND(COUNTIF(\$A\$2:A2,A2)=1,IFERROR(SEARCH("amd",B2),0)=0,NOT(ISBLANK(D2)),IFERROR(FIND("N/A",E2),0)=0),1,0)

See the attached file for the breakout; there are four columns to the right that show each test.

Regards,
Glenn
EE_Summary_Count_WOs-mod.xlsx
0

Author Comment

ID: 41827133
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
0

LVL 33

Expert Comment

ID: 41827628
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.
0

Author Comment

ID: 41828126
Thanks, Rob, for the tip....

Andrea
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
###### Suggested Courses
Course of the Month4 days, 23 hours left to enroll