Calculate days between two dates but from the fiscal year if start date precedes April

SaraWitch

Active Member
Joined
Sep 29, 2015
Messages
322
Office Version
  1. 365
Platform
  1. Windows
Hello peeps.

I am trying to work out the number of nights in the fiscal year between two dates (a start and an end date), as well as having the total number of days overall (i.e., if the start date precedes a date in April). I also want it to calculate to today as the end date if the end date is blank.

I can calculate the overall total number of days, no problem (
Excel Formula:
=IF(A2="","",IF(B2>0,B2-A2,TODAY()-B2))
), but I'm having difficulty in calculating the fiscal number of days.

My start date is in A2, my end date is in B2 and my fiscal year date in C1. The formula I'm using (which isn't working!) is:
Excel Formula:
=IF(A2="","",IF(A2<C1,IF(B2>0,B2-C1,TODAY()-C1)))

Any help would be gratefully received...
:)
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try this. But, I'm not sure why you say nights? Is this something that is different from days, Are you wanting to include the last day of the sequence in the count?

Mr Excel Questions 72.xlsm
ABCDEF
1StartEndFiscal NightsFiscal Yr Start2023-04-01
22023-06-132023-07-3047
32023-04-202023-08-04106
42023-05-052023-08-23110
52023-03-042023-07-23113
62023-04-032023-08-07126
72023-04-042023-08-14132
82023-02-142023-07-26116
92023-01-022023-07-23113
102023-05-032023-08-0291
112023-02-112023-07-0191
122023-05-03188
132023-02-11220
SaraWitch
Cell Formulas
RangeFormula
C2:C13C2=IF($B2="",TODAY(),$B2)-IF($F$1<=$A2,$A2,$F$1)
 
Upvote 0
Solution
That works perfectly; thank you, @awoohaw! And, apologies - nights and days same thing (in this case anyway!).

Thank you! :giggle:
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

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