Calculate number of days left including today

Ironman

Well-known Member
Joined
Jan 31, 2004
Messages
1,069
Office Version
  1. 365
Platform
  1. Windows
Hi

A2 contains today's date
Excel Formula:
=UPPER(TEXT(TODAY(),"d mmm yyyy"))

A6 contains the formula
Excel Formula:
=DATE(YEAR(A2),12,31)-A2
which is the number of days remaining in the current year.

Column A12 down contains dates from Jan 1 1998 onwards.

What I'm after is an amended formula for A6 so if the last cell in Col A does not also contain today's date then the formula in A6 adds 1 to the result (and if the last cell does contain today's date then the A6 formula result remains as it is).

If it can only be done with VBA then I'd also be grateful for a bit of worksheet_change event code that will enable this.

Many thanks!
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Resolved

Excel Formula:
=DATE(YEAR(TODAY()),12,31)-LOOKUP(10^35,A:A)
 
Upvote 0
Maybe this?
=IF(INT(A2)=INT(LOOKUP(1,1/(A:A<>""),A:A)),DATE(YEAR(A2),12,31)-A2,DATE(YEAR(A2),12,31)-A2+1)
 
Upvote 0
Solution

Forum statistics

Threads
1,214,858
Messages
6,121,960
Members
449,057
Latest member
FreeCricketId

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