Countif on a lookup range

shadow139

New Member
Joined
Aug 15, 2017
Messages
3
Hello,

I need help on how to to count a specific value on a range after a lookup. Basically, I want to count the number of values with a condition which is date (Weekend date). Is there a way to lookup the range instead of manually inputting every time I need to count a specific value in range of dates? Also is it possible to make the formula dynamic? I need to calculate data for years.

Example: If WE 8.5 appears on any column, count how many absences under those columns.

WE 8.5WE 8.5WE 8.5WE 8.5WE 8.5WE 8.12WE 8.12WE 8.12WE 8.12WE 8.12
1-Aug2-Aug3-Aug4-Aug5-Aug6-Aug7-Aug8-Aug9-Aug10-Aug
Person 1PresentAbsentPresentPresentPresentPresentABSENTRDRDAbsent
Person 2PresentAbsentPresentRDPresentPresentRDPresentAbsentAbsent
Person 3PresentAbsentPresentRDPresentPresentRDPresentAbsentAbsent
Person 4RDAbsentPresentPresentRDPresentABSENTPresentAbsentAbsent
Person 5RDAbsentPresentPresentRDRDSABSENTPresentAbsentAbsent

<colgroup><col><col><col span="9"></colgroup><tbody>
</tbody>


Output Table here:

AbsentPresentAbsentRD
WE 8.59
WE 8.12
WE 8.19
WE 8.26

<colgroup><col><col><col span="3"></colgroup><tbody>
</tbody>













Thanks in advance.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I'm not sure where you're getting 9 from but....

B12=SUMPRODUCT(($B$1:$K$1=$A12)*($B$3:$K$7=B$11))

Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
K​
1​
WE 8.5WE 8.5WE 8.5WE 8.5WE 8.5WE 8.12WE 8.12WE 8.12WE 8.12WE 8.12
2​
1-Aug
2-Aug
3-Aug
4-Aug
5-Aug
6-Aug
7-Aug
8-Aug
9-Aug
10-Aug
3​
Person 1PresentAbsentPresentPresentPresentPresentABSENTRDRDAbsent
4​
Person 2PresentAbsentPresentRDPresentPresentRDPresentAbsentAbsent
5​
Person 3PresentAbsentPresentRDPresentPresentRDPresentAbsentAbsent
6​
Person 4RDAbsentPresentPresentRDPresentABSENTPresentAbsentAbsent
7​
Person 5RDAbsentPresentPresentRDRDSABSENTPresentAbsentAbsent
8​
9​
10​
11​
AbsentPresentAbsentRD
12​
WE 8.5
5​
14​
5​
6​
13​
WE 8.12
12​
8​
12​
4​
14​
WE 8.19
0​
0​
0​
0​
15​
WE 8.26
0​
0​
0​
0​

<tbody>
</tbody>
 
Upvote 0
One more thing. Actually, two.

Similar table but this time, it contains numbers.

WE 8.5WE 8.5WE 8.5WE 8.5WE 8.5WE 8.5WE 8.12WE 8.12WE 8.12
Person 1100
6599RDRD120100100100
Person 2RDRD556644999520RD
Person 3100100120122RDRD525532
Person 415089RDRD9080998878

<tbody>
</tbody>














1. I would like to sum all the numbers in all column that contains WE 8.5. I tried this formula =SUMPRODUCT((range1="WE 8.5")*(range2>0)) but it only returned 294 which is incorrect.

2. I would like to count how many cells that contains numbers with the same argument above.
 
Upvote 0
THANK YOU SOOOOOOO very much for posting this, Weazel! This is the most amazing formula I've run across in a long long time! This may be the best thing since Slicers!

:)


I'm not sure where
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,511
Messages
6,125,250
Members
449,218
Latest member
daynle

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