How to cover date to one year ago (2005 -> 2004)

tsunami1977

Board Regular
Joined
Jan 24, 2005
Messages
64
I find information on this board to be very helpful, so I hope this question is not too basic.

I have created a set of data for 2004 and 2005. A summary page is using HLOOKUP to pull the right month's data. But if I enter 1/1/05, I need to subtract by 366 to get 1/1/04. This is same for Feb'05. But for the rest of 2005, I only need to subtract by 365. Is there a way for Excel to cover the 2004 to 2005 more simply? The HLOOKUP can only work if the dates are exactly the same, meaning that if the date is 1/2/04, it will not work. It has to be 1/1/04 to work.

Please let me know if anyone can help.

Thank you! :rolleyes:
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
How about using this instead (which will always give you same date one year ago) assuming the date is in cell A1:

=DATE(YEAR(A1)-1,MONTH(A1),DAY(A1))
 
Upvote 0
How about using this instead (which will always give you same date one year ago) assuming the date is in cell A1:

=DATE(YEAR(A1)-1,MONTH(A1),DAY(A1))
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
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