2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

Perform an "OR" operation on a list of criteria within an if statement.

Our take

Managing extensive defect data can be daunting, especially when you need to filter specific defect types while performing monthly analyses. Your current COUNTIFS function efficiently counts defects by date, but it retrieves all variations of defect descriptions—creating unnecessary complexity. To streamline your process, consider using an "OR" operation within your IF statement. This allows you to consolidate multiple defect descriptions into a single, manageable query. Let's explore how to implement this approach effectively, ensuring your analysis remains precise and insightful.

Hello everyone,

I have over 50,000 rows of defect data and I'm looking to sort them by month for a statistical analysis.

I want to count the number of defects in a given area (column H in the "Defects" sheet), perform a monthly count (date in column C of the "Defects" sheet), but only retrieve a specific type of defect (column J of the "Defects" sheet).

I'm using the following function, which solves the first part of my problem:

=COUNTIFS('Defects'!$H:$H,$B2,'Defects'!$C:$C,">=" & E$2,Defects'!$C:$C,"<" & E$3)

Basically, I check the date (the month is in the second row of my document) of my defect (first column B) and I check for each one if it falls between the first of the month (inclusive) and the first of the following month (exclusive).

I haven't found anything better... if you have any ideas to improve it, I'm all ears.

Otherwise, my problem is that this method retrieves all types of defects for each zone. Since the defect descriptions have changed several times over the past year, I've ended up with multiple descriptions for the same type of defect, and I don't want to include them all.

I've grouped all the descriptions into one column, but there are about fifteen of them. Is there a way to do something like this:

COUNTIF(DefectNames; OR(ListNameDefectNames))

? Basically, a function or a way to use "OR" without having to rewrite all the defect descriptions?

That's not very clear, I apologize.

Thank you in advance for your help!

submitted by /u/nadarr2001
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article

Related Articles

Tagged with