Multicriteria error

babuifav

New Member
Joined
Mar 24, 2024
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I am trying to count how many word chassis from column Failure to Failure 7 was found on 2023. But I have an error #Value. Not sure what I am doing incorrect.

=COUNTIFS(Data[[FAILURE ]:[FAILURE7]],"Chassis",Data[Year],"2023")

=COUNTIFS(Data[Year],B18,Data[[FAILURE]],"Chassis",Data[FAILURE2],"Chassis",Data[FAILURE3],"Chassis",Data[FAILURE4],"Chassis",Data[FAILURE5],"Chassis",Data[FAILURE6],"Chassis",Data[FAILURE7],"Chassis"). Error was 0 and it should be 8.

=SUMPRODUCT(--(Data[[FAILURE ]:[FAILURE7]]="Chassis"),--(Data[Year]=2023)). Error #Value!

Thank you
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
can you share the split of data including headings showing the formula and the output, plus expected output.
 
Upvote 0
Welcome to the MrExcel board!

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have the available functions, then try
Excel Formula:
=LET(f,TOCOL(Data[[FAILURE]:[FAILURE7]]),IFNA(ROWS(FILTER(f,f="Chassis",NA())),0))
 
Upvote 0
Welcome to the MrExcel board!

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have the available functions, then try
Excel Formula:
=LET(f,TOCOL(Data[[FAILURE]:[FAILURE7]]),IFNA(ROWS(FILTER(f,f="Chassis",NA())),0))[/CODE
[/QUOTE]

can you share the split of data including headings showing the formula and the output, plus expected output.
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    9.8 KB · Views: 4
  • Capture2.JPG
    Capture2.JPG
    34.9 KB · Views: 3
  • Capture3.JPG
    Capture3.JPG
    39.8 KB · Views: 3
Upvote 0
Welcome to the MrExcel board!

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have the available functions, then try
Excel Formula:
=LET(f,TOCOL(Data[[FAILURE]:[FAILURE7]]),IFNA(ROWS(FILTER(f,f="Chassis",NA())),0))
Thank you Peter, I updated my account for 365 version.
I wasn't able to replicate with the function LET :(
 
Upvote 0
Not sure what I am doing incorrect
COUNTIFS requires all ranges used to be the same size and shape. Your first range has more columns than the second, so it won't work. You can use SUMPRODUCT:

Excel Formula:
=SUMPRODUCT((Data[[FAILURE ]:[FAILURE7]]="Chassis")*(Data[Year]=2023))
 
Upvote 0
COUNTIFS requires all ranges used to be the same size and shape. Your first range has more columns than the second, so it won't work. You can use SUMPRODUCT:

Excel Formula:
=SUMPRODUCT((Data[[FAILURE ]:[FAILURE7]]="Chassis")*(Data[Year]=2023))
Yeahhhhh... it worked :) thank you.
 
Upvote 0
I wasn't able to replicate with the function LET :(
Probably because I made a couple of mistakes.
I missed that it seems your "FAILURE " column has a space character at the end & I forgot about the year check.

Here is my small dummy sample data with corrections for those two errors. I've manually coloured the 4 cells that the formula has counted.
(Probably simpler to stick with the SUMPRODUCT formula though :))

babuifav.xlsm
ABCDEFG
1YearFAILURE FAILURE1FAILURE7FAILURE8
22023ChassisBodyChassis4
32022ChassisOtherOther
42021WheelsChassisChassis
52023ChassisChassisChassisChassis
6
7
Sheet1
Cell Formulas
RangeFormula
G2G2=LET(f,Data[[FAILURE ]:[FAILURE7]],c,TOCOL(IF(Data[Year]=2023,f,""),1),IFNA(ROWS(FILTER(c,c="Chassis",NA())),0))
 
Upvote 0

Forum statistics

Threads
1,215,353
Messages
6,124,463
Members
449,163
Latest member
kshealy

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