countifs with different dimensions and multiple criteria

mira2020

New Member
Joined
Sep 25, 2020
Messages
27
Office Version
  1. 2016
I want to count number of items but lookup for value both in column and row.
i try countifs but it does not work. How to make the count if the range are changable
Please help. Thanks

here is my sample : countif.xlsx
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
You have spaces after some of the names, remove them.
Also you need to anchor one of the criteria cells like
=COUNTIFS(A:A,E2,C:C,F2,B:B,G$1)
 
Upvote 0
Hi Mira2020,

I'm unsure why your G2 is showing zero as it correctly shows 2 in my example, but the reason the formula won't copy down is you need to make the reference to "High" and "Low" absolute so it always checks row 1

Mira2020.xlsx
ABCDEFGH
1FruitPriorityMonthFruitMonthHighLow
2AppleHigh01-Sep-20Apple01-Sep-2021
3AppleHigh01-Sep-20Orange01-Sep-2001
4OrangeLow01-Sep-20Banana01-Sep-2000
5BananaMedium01-Sep-20Apple01-Oct-2011
6AppleLow01-Sep-20Orange01-Oct-2011
7AppleMedium01-Sep-20Banana01-Oct-2000
8OrangeHigh01-Oct-20
9AppleHigh01-Oct-20
10OrangeLow01-Oct-20
11BananaMedium01-Oct-20
12AppleLow01-Oct-20
Sheet1
Cell Formulas
RangeFormula
G2:G7G2=COUNTIFS(A:A,E2,C:C,F2,B:B,G$1)
H2:H7H2=COUNTIFS(A:A,E2,C:C,F2,B:B,H$1)
 
Upvote 0
There's a trailing space after the word in E2. ;)

I see them on the OneDrive (also E5, A12) but strangely they didn't appear in my Excel when I copy & pasted from the OneDrive web screen.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,960
Messages
6,122,479
Members
449,088
Latest member
Melvetica

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