Auto Counting by date

abdulla88

New Member
Joined
Jan 23, 2021
Messages
14
Office Version
  1. 2019
Platform
  1. Windows
Hello everybody,

Can someone help me solve this equation?
I would like to calculate the number of nationalities by date priority (5 days before starting today), as shown in the small table.


New Microsoft Excel Worksheet (2).xlsx
ABCDE
1DateNationality
225-Jul-21citizen
324-Jul-21Foreigner
422-Jul-21citizen
522-Jul-21citizen
621-Jul-21citizen
720-Jul-21Foreigner
801-Jul-21citizen
902-Jul-21Foreigner
1010-Jul-21citizen
1126-Jul-21citizen
12
13TotalNationality
141Foreigner
154citizen
Sheet1
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
@abdulla88 Try this.

MRXLMAY21.xlsm
ABCDE
1DateNationality
225-Jul-21citizen
324-Jul-21Foreigner
422-Jul-21citizen
522-Jul-21citizen
621-Jul-21citizen
720-Jul-21Foreigner
801-Jul-21citizen
902-Jul-21Foreigner
1010-Jul-21citizen
1126-Jul-21citizen
12
13TotalNationality
141Foreigner
154citizen
Result
Cell Formulas
RangeFormula
D14:D15D14=COUNTIFS(B:B,E14,A:A,">"&TODAY()-5,A:A,"<="&TODAY())


Hope that helps.
 
Upvote 0
Solution
@abdulla88 Try this.

MRXLMAY21.xlsm
ABCDE
1DateNationality
225-Jul-21citizen
324-Jul-21Foreigner
422-Jul-21citizen
522-Jul-21citizen
621-Jul-21citizen
720-Jul-21Foreigner
801-Jul-21citizen
902-Jul-21Foreigner
1010-Jul-21citizen
1126-Jul-21citizen
12
13TotalNationality
141Foreigner
154citizen
Result
Cell Formulas
RangeFormula
D14:D15D14=COUNTIFS(B:B,E14,A:A,">"&TODAY()-5,A:A,"<="&TODAY())


Hope that helps.
Many thanks,


it's working like magic :)
 
Upvote 0

Forum statistics

Threads
1,214,571
Messages
6,120,302
Members
448,954
Latest member
EmmeEnne1979

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