Countif with hlookup

kieran0114

New Member
Joined
Jul 9, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello everyone. First post here but looking for some help.

In the attached, I am looking to write a formula in cells b9:b12 that would look at the current date (cell a7) and find that date in the header of a1:f5 and count the number of times each letter shows in that column based off the corresponding letters in a9:a12. In the example, b9=1, b10=1, and b11=1


I can’t seem to figure this out and I’m sure it is easy for most ya’ll, but looking for any help!

Thanks!
 

Attachments

  • Excel example.png
    Excel example.png
    67.7 KB · Views: 12

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
One thing to add, I would like to return a blank in cells b9:b12 if the letter does not show! So B12 in the example above would be blank.
 
Upvote 0
Try this in B9:

=LET(a,COUNTIF(INDEX($B$2:$F$5,0,MATCH($A$7,$B$1:$F$1,0)),$A9),IF(a=0,"",a))
 
Upvote 0
try

B9
Excel Formula:
=SUMPRODUCT(--(FILTER($B$2:$F$5,($B$1:$F$1=$A$7),"")=A9))
 
Upvote 0
Another option:
Book1
ABCDEF
17/8/247/9/247/10/247/11/247/12/24
2P1V
3P2SS
4P3VVVR
5P4LLLLL
6
77/10/24
8CategoryCount
9V1
10S 
11R 
12L1
Sheet2
Cell Formulas
RangeFormula
B9:B12B9=LET(s,SUM(($B$1:$F$1=$A$7)*($B$2:$F$5=A9)),IF(s,s,""))
 
Upvote 0
Thanks for all the help. All suggestions work and got me on my way. Appreciate the quick responses and impressed with the knowledge. Definitely will post again here next time i run into a formula issue.
 
Upvote 0

Forum statistics

Threads
1,223,905
Messages
6,175,297
Members
452,633
Latest member
DougMo

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