Dropdown behaviour shows different data depending on selection

TheJay

Active Member
Joined
Nov 12, 2014
Messages
364
Office Version
  1. 2019
Platform
  1. Windows
FIrst of all, apologies for the title, I don't know how to change it and realised I wanted to use a tick box instead of a drop down as I was writing.

I have a spreadsheet which calculates the charge for a date range.
xU4Coxz.png


Now I want to introduce a tick box in C6, which changes whether the inclusive or exclusive end is shown in C7 and relevant data in C8. As well as the data changing, when the tick box is clicked, I'd like the text in C6 to change from 'Exclusive End' to 'Inclusive End'.

The idea is that I don't want anything in row D because I need to incorporate other data eventually in that row. Not sure how this is achieved, can it be done without hidden cells?

The forum wont let me attach the spreadsheet :(
 
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.
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
PAkn0mS.png


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.
 
Upvote 0
This is the formula calculating the number of days:

VBA Code:
=IF(ISBLANK(C6),"",(DATEDIF(C5,C6-(B7),"d")))
 
Upvote 0
Try it without datedif, for simple date calculations like his, the function is no needed.

=IF(ISBLANK(C6),"",C6-C5-B7)
 
Upvote 0
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:
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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)
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,412
Members
448,959
Latest member
camelliaCase

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