countifs with criteria range by column and in rows (2 rows) one row is by date

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
289
Office Version
  1. 365
Platform
  1. Windows
Hello Experts,

I am stuck with this excel problem.

I would like to count how many A, B and C on a table with criteria based on column and in rows. In which, one of the row criteria is range from January 01, 2020 up to December 31, 2020. Please see screen shot. (formula should be place on the yellow highlight).

1607001719175.png


I really appreciate your help.

Thank you very much.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Try this in O4, then drag right and down to fill the table.
Excel Formula:
=IFERROR(1/(1/COUNTIFS($C$3:$L$3,">="&DATEVALUE(LOOKUP("zzz",$O$2:O$2)&2020),$C$3:$L$3,"<="&EOMONTH(DATEVALUE(LOOKUP("zzz",$O$2:O$2)&2020),0),$C4:$L4,O$3)),"")
This assumes N4:N7 will have the same names in the same order as B4:B7, if not an additional INDEX and MATCH combination will need to be added into the formula.
 
Upvote 0
Try this in O4, then drag right and down to fill the table.
Excel Formula:
=IFERROR(1/(1/COUNTIFS($C$3:$L$3,">="&DATEVALUE(LOOKUP("zzz",$O$2:O$2)&2020),$C$3:$L$3,"<="&EOMONTH(DATEVALUE(LOOKUP("zzz",$O$2:O$2)&2020),0),$C4:$L4,O$3)),"")
This assumes N4:N7 will have the same names in the same order as B4:B7, if not an additional INDEX and MATCH combination will need to be added into the formula.
Sir, the names will not be in order. How, can I insert index and match?..Honestly, I am lost with your given formula.. thanks
 
Upvote 0
In that case, try
Excel Formula:
=IFERROR(1/(1/COUNTIFS($C$3:$L$3,">="&DATEVALUE(LOOKUP("zzz",$O$2:O$2)&2020),$C$3:$L$3,"<="&EOMONTH(DATEVALUE(LOOKUP("zzz",$O$2:O$2)&2020),0),INDEX($C:$L,MATCH($N4,$B:$B,0),0),O$3)),"")
If this does not work as expected then you will need to post your example using XL2BB (see link in my signature block below) so that we can use the data to test the formulas.
 
Upvote 0
Solution
In that case, try
Excel Formula:
=IFERROR(1/(1/COUNTIFS($C$3:$L$3,">="&DATEVALUE(LOOKUP("zzz",$O$2:O$2)&2020),$C$3:$L$3,"<="&EOMONTH(DATEVALUE(LOOKUP("zzz",$O$2:O$2)&2020),0),INDEX($C:$L,MATCH($N4,$B:$B,0),0),O$3)),"")
If this does not work as expected then you will need to post your example using XL2BB (see link in my signature block below) so that we can use the data to test the formulas.
It works as expected..Thank you so much sir..
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

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