Count Days between dates

johnce123

New Member
Joined
Jan 6, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Good Evening,

I would like to be able to Set a specific date range and count total available days between these date ranges given the table below

Example - Search for the following
Cell a1 Start Date 01/03/2021
cell a2 End Date 31/03/2021
cell a3 Code - CFGOLD8

The formula needs to check if the days fall between the start date and end date in the table below, and how many in total.
It then needs to sum these days up for that particular grade. In this example we would have 2 of the same grades, one with 31 days available and the other with 15 days available - so it returns 46

I hope that kind of makes sense and that its possible! TIA :)

CodeEnd DateEntity No.Entity Park CodeEntity TypeStart DateType
CFPLAT8
31/12/9999​
U000000001Unit
01/01/2000​
Grade
CF
31/12/9999​
U000000001Unit
01/01/2020​
Park
CFJG127
31/12/9999​
U000000001Unit
01/01/2020​
Plot
NSGOLD6
31/12/9999​
U000000002Unit
01/01/2000​
Grade
NS
31/12/9999​
U000000002Unit
01/01/2020​
Park
NSHF17
31/12/9999​
U000000002Unit
01/01/2020​
Plot
CFGOLD8
15/03/2021​
U000000003Unit
01/01/2000​
Grade
CF
31/12/9999​
U000000003Unit
01/01/2020​
Park
CFJG134
31/12/9999​
U000000003Unit
01/01/2020​
Plot
CFGOLD8
31/12/9999​
U000000004Unit
01/01/2000​
Grade
CF
31/12/9999​
U000000004Unit
01/01/2020​
Park
CFJG087
31/12/9999​
U000000004Unit
01/01/2020​
Plot
MFGOLD8
31/12/9999​
U000000005Unit
01/01/2000​
Grade
MF
31/12/9999​
U000000005Unit
01/01/2020​
Park
MFW0014
31/12/9999​
U000000005Unit
01/01/2020​
Plot
GLGOLD8
31/12/9999​
U000000006Unit
01/01/2000​
Grade
GL
31/12/9999​
U000000006Unit
01/01/2020​
Park
GLGV092
31/12/9999​
U000000006Unit
01/01/2020​
Plot
GLGOLD8P
31/12/9999​
U000000007Unit
01/01/2000​
Grade
GL
31/12/9999​
U000000007Unit
01/01/2020​
Park
GLGV075
31/12/9999​
U000000007Unit
01/01/2020​
Plot
CFGOLD8P
31/12/9999​
U000000008Unit
01/01/2000​
Grade
CF
31/12/9999​
U000000008Unit
01/01/2020​
Park
CFJG142
31/12/9999​
U000000008Unit
01/01/2020​
Plot
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Assuming you have your data table in range C1:I25, see if the following formula works for you:
Excel Formula:
=SUMPRODUCT((C2:C25=A3)*({-1,1}*ABS(A2*{1,-1}-D2:D25)-ABS(H2:H25-A1*{1,-1})+1))/2
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

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