Multiple Search Criteria in Excel Table

Tuffman

New Member
Joined
May 31, 2012
Messages
49
Office Version
  1. 2016
Platform
  1. Windows
I need help in doing the following please.

I first need to search down column B (the MAKE column) on the Cars worksheet to find the Toyota vehicles. Once the search finds Toyota it needs to record the first MODEL found from column A and paste/insert that once into cell B2 on the Summary worksheet. Then while the model type is the stays the same, it would search for all Used (the CONDITION column) cars where the YEAR is 2000 or newer, and count the number of Red, White, and Blue vehicles in the COLOR column and provide those answers in cells B3, B4, and B5 respectively on the Summary worksheet. If the YEAR has blanks, then the search would ignore the information in that row. Once the search finds the next Toyota MODEL it would record that in C2 on the Summary worksheet and then count the number of Red, White, and Blue Used vehicles that are the year of 2000 or newer. Below is the sheet to search on, a blank, summary table to record the data, and an example table of what the summary data should look like.


Car Example.xlsx
ABCDE
1MODELMAKECOLORYEARCONDITION
2TaurusFordWhite2000Used
3TaurusFordBlue1995Wrecked
4TaurusFordRed2007Used
5TaurusFordRed2010Wrecked
6TaurusFordBlue1990Used
7TaurusFordBlue1994Wrecked
8TaurusFordWhite2011Used
9CamryToyotaRed2020Wrecked
10CamryToyotaWhite2013Used
11CamryToyotaBlue1997Wrecked
12CamryToyotaWhite2000Used
13CamryToyotaBlue2010Wrecked
14CamryToyotaRed2007Used
15CamryToyotaRed1994Wrecked
16CamryToyotaBlue2017Used
17CamryToyotaBlue2021Wrecked
18CamryToyotaWhite2019Used
19CamryToyotaWhite2020Wrecked
20CamryToyotaRed1999Used
21CamryToyotaRed2023Wrecked
22CamryToyotaWhiteUsed
23CamryToyotaBlueWrecked
24TacomaToyotaRed2003Used
25TacomaToyotaBlue2017Wrecked
26SierraGMCRed1990Used
27SierraGMCWhite1994Wrecked
28SierraGMCBlue2011Used
29SierraGMCWhite2020Wrecked
30SierraGMCBlue2000Used
31SierraGMCRed2021Wrecked
Cars


Car Example.xlsx
ABC
2Toyota
3Red
4White
5Blue
6
7
8
9
10
11
12Example
13ToyotaCamryTacoma
14Red11
15White30
16Blue10
Summary
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Book1
ABCDEFGHI
1MODELMAKECOLORYEARCONDITIONToyotaCamryTacoma
2TaurusFordWhite2000UsedRed11
3TaurusFordBlue1995WreckedWhite30
4TaurusFordRed2007UsedBlue10
5TaurusFordRed2010Wrecked
Sheet1
Cell Formulas
RangeFormula
H2:I4H2=COUNTIFS($A:$A,H$1,$B:$B,$G$1,$C:$C,$G2,$D:$D,">=2000",$E:$E,"Used")
Named Ranges
NameRefers ToCells
_FilterDatabase=Sheet1!$A$1:$E$31H2:I4
 
Upvote 0
You can also use pivot table to achieve the required results :

Book5
GHIJ
1MAKEToyota
2CONDITIONUsed
3YEAR(Multiple Items)
4
5Count of CONDITIONColumn Labels
6Row LabelsCamryTacomaGrand Total
7Red112
8White44
9Blue11
10Grand Total617
Sheet1
 
Upvote 0
Sorry, I need to know how to write the code in VBA to do what I described. My fault for not specifying that.
 
Upvote 0
Really? VBA? For something what can be done with simple, quick, easy formula? That's your choice but I do not see the point.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,117
Members
453,021
Latest member
Justyna P

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