Help with DATEDIF function dependent on if today's date appears in last row of column

Ironman

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

I have the following formula in Cell A10:

=(DATEDIF(TODAY(),DATE(YEAR(TODAY()),12,31),"d"))+1

This calculates the number of potential activity days left in the year.

However, as it's only based on the calendar, the result is incorrect when the current day's activity has taken place.

What I'd be grateful for this formula to be amended, so if the current date appears in the last filled cell in Column A, it subtracts 1 from the result.

Many thanks!
 
Last edited:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Brilliant! Many thanks indeed Phuoc, that works perfectly!

Could I also please ask you how I can use your formula if I want to calculate the number of days gone in the current year (again, taking account of if today's date appears in the last filled cell in Column A)?

Thanks again!
 
Upvote 0
Ah, I've just managed to do it...

=-(DATE(YEAR(TODAY()),1,1)-LOOKUP(10^35,A:A))+1

Thanks again!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

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