Figuring out total counts of C based on A's relation to B.

LeSteve

New Member
Joined
Aug 8, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I'm struggling to figure out exactly what it is I'm trying to do - so apologies if this is a garbled mess
I'm trying to get a count of something depending on how many times its referenced with another value.
I've made a mock up similar to what I'm trying to do:

1723135150607.png


Due to the way I'm getting the data, the items on sheet 1 and 2 are separate, but I'm trying to get a count of how many cars would have metallic paint?
I know in the example it should be 3 but I cant seem to get it to add up using countifs or sumifs.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Would something like this work?:

Excel Formula:
=LET(
vehicle, A2:A17,
paintColor, B2:B17,
paintFinish, XLOOKUP(paintColor, Sheet2!A2:A5, Sheet2!B2:B5, 0),
IFERROR(ROWS(FILTER(vehicle, (vehicle="Car")*(paintFinish="Metallic"))), 0)
)

or

Excel Formula:
=LET(vehicle, A2:A17,
paintColor, B2:B17,
paintFinish, XLOOKUP(paintColor, Sheet2!A2:A5, Sheet2!B2:B5, 0),
SUM((vehicle="Car")*(paintFinish="Metallic"))
)
 
Upvote 1
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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