Dropdown behaviour shows different data depending on selection

TheJay

Board Regular
Joined
Nov 12, 2014
Messages
141
That's brilliant, thanks very much! I even managed to set up my Reset macro to add the word 'Reset' and delete it from the cell that is being validated to figure out whether the checkbox should appear or not.
 

TheJay

Board Regular
Joined
Nov 12, 2014
Messages
141


Could you please help me figure out how I can get this to work on leap year? The calculation is clearly out by a day.

I want this to be flexible enough to work whether the dates are in a leap year or not, but it should always be looking at whether within the full financial year (up to and including 31/03) there is an additional day.
 

TheJay

Board Regular
Joined
Nov 12, 2014
Messages
141
This is the formula calculating the number of days:

VBA Code:
=IF(ISBLANK(C6),"",(DATEDIF(C5,C6-(B7),"d")))
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
6,910
Office Version
2019
Platform
Windows
Try it without datedif, for simple date calculations like his, the function is no needed.

=IF(ISBLANK(C6),"",C6-C5-B7)
 

TheJay

Board Regular
Joined
Nov 12, 2014
Messages
141
Thanks for your reply, the output is the same when I try replacing the formula with your suggestion. What else can I try? Is there a way to make Excel look at the period 01/04/YEAR to 31/03/FOLLOWING YEAR to check for a leap year day and then start the calculations after that?
 
Last edited:

TheJay

Board Regular
Joined
Nov 12, 2014
Messages
141
It would need to look at the dates entered and identify whether the end date input in C6 comes before 01/04 the following year and whether before 01/04 the following year, February contains an extra day.
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
6,910
Office Version
2019
Platform
Windows
Sorry, I wasn't following what you were asking before. I see it now.

I have done it before but can't remember how. I'll have a look through some of my old files and replies later to see if I can find it.
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
6,910
Office Version
2019
Platform
Windows
I couldn't find the old thread / file. Before I look at ways to do what you need, thinking out of the box -

Start date 25/03/2020
End date 05/04/2020

Assuming end date inclusive, should the above dates be calculated as (£789.03/366*7)+(£789.03/365*5)
 

Forum statistics

Threads
1,078,440
Messages
5,340,296
Members
399,364
Latest member
farhan11941234

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top