COUNTIFS, VLOOKUP

TrinaT

New Member
Joined
Mar 23, 2022
Messages
14
Office Version
  1. 365
Platform
  1. MacOS
Can you combine a countifs with a vlookup?

I have some data that has been broken down to an individual list, which I then need to collate back into a central Dashboard for one of our people to easily digest the information.

This is the table of data that I want to pull the information from:

Sample Data.xlsx
ABCDEF
1First NameLast NameColumn1ItemCostQty
2JoeBlogsJoe BlogsAdult Registration1651
3JoeBlogsJoe BlogsAdult Registration1651
4JohnDohJohn DohMascot271
5JohnDohJohn DohT-Shirt - Ladies (V-Neck)401
6JohnDohJohn DohT-Shirt - Mens402
7JohnDohJohn DohAdult Registration1651
8JohnDohJohn DohAdult Registration1651
9JessieJamesJessie JamesHooded Sweat851
10JessieJamesJessie JamesT-Shirt - Ladies (V-Neck)401
11JessieJamesJessie JamesT-Shirt - Mens401
12JessieJamesJessie JamesAdult Registration1651
13JessieJamesJessie JamesAdult Registration1651
14MarkBanksMark BanksAdult Registration1651
15MarkBanksMark BanksAdult Registration1651
16JeffJonesJeff JonesCooler Bag101
17JeffJonesJeff JonesT-Shirt - Ladies (V-Neck)401
18JeffJonesJeff JonesT-Shirt - Mens401
19JeffJonesJeff JonesAdult Registration1651
20JeffJonesJeff JonesAdult Registration1651
21ShaneWilliamsShane WilliamsShirt - Long Sleeve601
22ShaneWilliamsShane WilliamsT-Shirt - Mens401
23ShaneWilliamsShane WilliamsAdult Registration1651
24ShaneWilliamsShane WilliamsChild Registration (under 12 years old)1001
25BarryAllenBarry AllenCooler Bag101
26BarryAllenBarry AllenShirt - Long Sleeve601
27BarryAllenBarry AllenT-Shirt - Mens401
28BarryAllenBarry AllenAdult Registration1651
29MarkMarkMark MarkAdult Registration1651
30MarkMarkMark MarkAdult Registration1651
31DaisyDukeDaisy DukeCooler Bag101
32DaisyDukeDaisy DukeShirt - Long Sleeve601
33DaisyDukeDaisy DukeT-Shirt - Ladies (V-Neck)401
34DaisyDukeDaisy DukeAdult Registration1651
35DaisyDukeDaisy DukeAdult Registration1651
tblSales
Cell Formulas
RangeFormula
C2:C35C2=CONCATENATE([@[First Name]]," ",[@[Last Name]])


This is the Dashboard that I'm wanting to pull it into:

Sample Data.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
18Details
19First NameLast NameFull Name Adult Registration Registration Child T-Shirt MensQtyColourSizeT-Shirt - Ladies (V-Neck)QtyColourSizeShirt - Long SleeveQtyColourSizeHooded SweatQtyColourSizeMascotQtyCooler BagQtyBar RunnerQty
20JoeBlogs Joe Blogs 0
21JohnDoh John Doh
22JessieJames Jessie James
23MarkBanks Mark Banks
24JeffJones Jeff Jones
25ShaneWilliams Shane Williams
26BarryAllen Barry Allen
27MarkMark Mark Mark
28DaisyDuke Daisy Duke
Dashboard
Cell Formulas
RangeFormula
A20:B28A20='Export Data'!A2
C20:C28C20=CONCATENATE(A20," ",B20)
D20D20=COUNTIF(tblSales!F:F,VLOOKUP("*"&Dashboard!D19&"*",tblSales_2[[Column1]:[Qty]],4,0))


I've tried this formula:

=COUNTIF(tblSales!F:F,VLOOKUP("*"&Dashboard!D19&"*",tblSales_2[[Column1]:[Qty]],4,0))

But it's not correct. Essentially on the Dashboard, I want to Vlookup the Name, and countif there is a row that contains the text in the relevant column (e.g. Adult Registration, T-Shirt Mens etc.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
You wouldn't need to use the VLOOKUP, but just COUNTIFS

Your D20 Formula would simply read as
Excel Formula:
=COUNTIFS(tblSales!$A:$A,Dashboard!$A20,tblSales!$B:$B,$B20,tblSales!$D:$D,Dashboard!D$19)

You actually wouldn't need the CONCATENATE function at all.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,826
Messages
6,181,192
Members
453,021
Latest member
pingpong7117

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