My formula does not recognise when it is a leap year. What do i need to add or use instead of?

Steve T

New Member
Joined
Oct 22, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
My formula does not recognise when it is a leap year.

The formula is used to hide dates, in my spreadsheet.

The formula is =IF(DAY(C$8+28)<>29,"",C$8+28)
What do i need to add or use instead of?
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Please explain what you want your formula to do. What dates are you trying to hide? I think we need the big picture here.
 
Upvote 0
Please explain what you want your formula to do. What dates are you trying to hide? I think we need the big picture here.
Hi

I have a the spreadsheets showing each day of the month. All dates are formulated from c8, which holds the 1st date of the month. for the cells holding the 29th,30th and 31st of the months, I have the formula stated in the original post. The formula recognises when a particular month, only has 28,29,30 days and makes the cell blank. However, it doesn't seem to recognise when it is a leap year.
 
Upvote 0
How about
Fluff.xlsm
CDEFGHIJKLMNOPQRSTUVWXYZAAABACADAE
801-Feb-2402-Feb-2403-Feb-2404-Feb-2405-Feb-2406-Feb-2407-Feb-2408-Feb-2409-Feb-2410-Feb-2411-Feb-2412-Feb-2413-Feb-2414-Feb-2415-Feb-2416-Feb-2417-Feb-2418-Feb-2419-Feb-2420-Feb-2421-Feb-2422-Feb-2423-Feb-2424-Feb-2425-Feb-2426-Feb-2427-Feb-2428-Feb-2429-Feb-24
Main
Cell Formulas
RangeFormula
D8:AE8D8=SEQUENCE(,DAY(EOMONTH(C8,0))-1,C8+1)
Dynamic array formulas.
 
Upvote 0
My formula does not recognise when it is a leap year.

The formula is used to hide dates, in my spreadsheet.

The formula is =IF(DAY(C$8+28)<>29,"",C$8+28)
What do i need to add or use instead of?
apologies guys. The formula I had does work. It would help if i'd checked the correct cell!

Thanks for the quick responses though
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,199
Members
453,022
Latest member
RobertV1609

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