Dynamic Reference with multiple criteria

zinah

Active Member
Joined
Nov 28, 2018
Messages
368
Office Version
  1. 365
Platform
  1. Windows
Hello everyone!
I have a table that can have different number of rows whenever I update the data. What I need is to get a formula that can accommodate all available rows, i.e. today's file has 1000 rows vs. last week was 998 and maybe tomorrow is 1001. Another component of the formula is I need to add multiple criteria to my current countif clause.
I was trying to paste the table here but has issues. Here's a sample of the table and my current formula:

Formula: =COUNTIF($C$3:$C$28,F3)
I need to add another criteria to the current formula to count Type 1 and 3 for date 11/29/2023. Any suggestions?

Name​
ID​
Date​
Type​
A​
30032​
11/29/2023​
1​
B​
60903​
11/28/2023​
1​
C​
93394​
11/29/2023​
2​
D​
76295​
11/29/2023​
2​
E​
79646​
11/29/2023​
1​
F​
63724​
11/29/2023​
1​
G​
63269​
11/29/2023​
2​
H​
97051​
11/29/2023​
2​
I​
79824​
11/27/2023​
1​
J​
39850​
11/29/2023​
2​
K​
79080​
11/29/2023​
1​
L​
88087​
11/29/2023​
3​
M​
35162​
11/29/2023​
2​
N​
54564​
11/29/2023​
3​
O​
37087​
11/29/2023​
2​
P​
92487​
11/26/2023​
1​
Q​
21703​
11/29/2023​
2​
R​
20914​
11/29/2023​
2​
S​
87354​
11/29/2023​
1​
T​
76313​
11/25/2023​
2​
U​
52217​
11/29/2023​
1​
V​
28653​
11/29/2023​
2​
W​
15879​
11/18/2023​
2​
X​
88872​
11/29/2023​
1​
Y​
30988​
11/29/2023​
1​
Z​
14774​
10/31/2023​
2​
 

Attachments

  • 2023-11-30 10_08_22-Window.png
    2023-11-30 10_08_22-Window.png
    33.1 KB · Views: 6

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I fixed the paste issue, and here's the table:
Cell Formulas
RangeFormula
B2:B27B2=RANDBETWEEN(10000,99999)
C2,C4:C9,C11:C16,C18:C20,C22:C23,C25:C26,F2C2=TODAY()-1
C3C3=TODAY()-2
C10C10=TODAY()-3
C17C17=TODAY()-4
C21C21=TODAY()-5
C24C24=TODAY()-12
C27C27=TODAY()-30
G2G2=COUNTIF($C$2:$C$27,F2)
 
Upvote 0
How about
Excel Formula:
=SUM(COUNTIFS(C:C,F2,D:D,{1,3}))
 
Upvote 0
Solution
As usual, the first to suggest the coolest solutions! this worked, it even worked when I added blank criteria.
"SUM(COUNTIFS(C:C,F2,D:D,{"",1}))"
Thanks a million!

How about
Excel Formula:
=SUM(COUNTIFS(C:C,F2,D:D,{1,3}))
 
Upvote 0
You're welcome & Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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