formula with multiple criteria

RattlingCarp3048

Board Regular
Joined
Jan 12, 2022
Messages
166
Office Version
  1. 365
Platform
  1. Windows
looking for help with creating a formula with multiple criteria. would prefer to stick with formula if possible.

on sheet 1 L3 =VLOOKUP(B3,'QC Exeptions'!P:P,1,0) need to add the following criteria....

search the vlookup on sheet "QC Exceptions"

If column T="no" leave "-".

If T = "yes" and H = "Minor" then count rows where all are true

hopefully this makes sense
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
not sure i follow what you are after fully
BUT
a countifs() may do
But you give 2 criteria for column T =

also not sure about the inverted commas

COUNTIFS( 'QC Exceptions'!T:T,"yes", 'QC Exceptions'!H:H,"minor")
But what exactly is the text within column T
T="no" leave "-"

And as you are counting , why the need for a vlookup ???

I think an example would help here


Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
 
Upvote 0
not sure i follow what you are after fully
BUT
a countifs() may do
But you give 2 criteria for column T =

also not sure about the inverted commas

COUNTIFS( 'QC Exceptions'!T:T,"yes", 'QC Exceptions'!H:H,"minor")
But what exactly is the text within column T
T="no" leave "-"

And as you are counting , why the need for a vlookup ???

I think an example would help here


Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
unfortunately i cannot post the mini-sheet. ive tried before but have IT restrictions as its a work computer. since posting ive had to limit the overall data which did change the column's a little. the concept and need is still the same. i may simply just be over thinking this entire process but let me explain in a little more detail. i have a spreadsheet with a "summary" tab and a "qc exceptions" tab. the formula will go into column L and a similar one in column M on the summary tab.

I need to find the name in column B on the summary tab that is somewhere in column D on the qc exception sheet. if column E is blank then do nothing, leave column L on the summary tab blank/-.
1646344853190.png
1646345093642.png



If column E says yes, then count the rows where column B=minor.

not sure if a filter, sort, count, etc combination my be more useful. ive tried several approaches, maybe im over-thinking it...
 
Upvote 0
what to do if no instead of yes

so the only match is eric4 as it has a yes - and do we count minor because thats in column B for eric4, or just that the column L is minor
and answer is 3

if eric1 had a yes, and has major in b, then would that count major and so 2 ?
or is that only applied to column M - Major exceptions

more examples and expected results would help

I think a IF with a lookup and countif should work

countifs('qc exception sheet'!$D$3:$D$10, B2, 'qc exception sheet'!$E$3:$E$10,"yes") >0
and
countif('qc exception sheet'!$B$3:$B$10, "minor')
maydo it

=IF( countifs('qc exception sheet'!$D$3:$D$10, B2, 'qc exception sheet'!$E$3:$E$10,"yes") >0 , countif('qc exception sheet'!$B$3:$B$10, "minor'), "")
 
Upvote 0
what to do if no instead of yes

so the only match is eric4 as it has a yes - and do we count minor because thats in column B for eric4, or just that the column L is minor
and answer is 3

if eric1 had a yes, and has major in b, then would that count major and so 2 ?
or is that only applied to column M - Major exceptions

more examples and expected results would help

I think a IF with a lookup and countif should work

countifs('qc exception sheet'!$D$3:$D$10, B2, 'qc exception sheet'!$E$3:$E$10,"yes") >0
and
countif('qc exception sheet'!$B$3:$B$10, "minor')
maydo it

=IF( countifs('qc exception sheet'!$D$3:$D$10, B2, 'qc exception sheet'!$E$3:$E$10,"yes") >0 , countif('qc exception sheet'!$B$3:$B$10, "minor'), "")
i think my confusion is how to syntax it all together or what formula function/combination would work best for these purposes. maybe this will help...

Summary L3 =VLOOKUP(B3,'QC Exceptions'!D:D,1,0), if qc exception = "yes" then count "minor"

summary M3 = =VLOOKUP(B3,'QC Exceptions'!D:D,1,0), if qc exception = "yes" then count "major"

results should look like this...
1646404488986.png
1646404522621.png
 
Upvote 0
so you are only counting the minor and major where there is a yes
=countifs('qc exception sheet'!$D$3:$D$10, B2, 'qc exception sheet'!$E$3:$E$10,"yes",'qc exception sheet'!$B$3:$B$10,"Minor")
will return 0 - you could set excel to not show zero but a dash OR
=IF ( countifs('qc exception sheet'!$D$3:$D$10, B2, 'qc exception sheet'!$E$3:$E$10,"yes",'qc exception sheet'!$B$3:$B$10,"Minor")>0, countifs('qc exception sheet'!$D$3:$D$10, B2, 'qc exception sheet'!$E$3:$E$10,"yes",'qc exception sheet'!$B$3:$B$10,"Minor") , "")

change minor to major for column M
 
Upvote 0
Solution
so you are only counting the minor and major where there is a yes
=countifs('qc exception sheet'!$D$3:$D$10, B2, 'qc exception sheet'!$E$3:$E$10,"yes",'qc exception sheet'!$B$3:$B$10,"Minor")
will return 0 - you could set excel to not show zero but a dash OR
=IF ( countifs('qc exception sheet'!$D$3:$D$10, B2, 'qc exception sheet'!$E$3:$E$10,"yes",'qc exception sheet'!$B$3:$B$10,"Minor")>0, countifs('qc exception sheet'!$D$3:$D$10, B2, 'qc exception sheet'!$E$3:$E$10,"yes",'qc exception sheet'!$B$3:$B$10,"Minor") , "")

change minor to major for column M
the second one worked perfectly. i tested it will several months worth of data and filtered multiple different ways and it worked every time. sorry for all the confusion in the beginning. Much appreciated!
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top