How to make a DATE, DATEVALUE formula?

seanxx

New Member
Joined
Apr 11, 2018
Messages
20
Office Version
  1. 2019
Platform
  1. Windows
Could you please advise me how to make the correct formula?
When the date is changed according to the formula, the result does not change
Thank you
Zošit2
ABCDEF
1
2
3
422.12.2024
5
628.02.2024
7
8
9
10
11
Hárok1
Cell Formulas
RangeFormula
D4D4=TODAY()
D6D6=IF(D4>=DATE(2024,2,28),DATEVALUE("28.2.2024"),IF(D4>=DATE(2025,1,1),DATEVALUE("1.1.2025"),IF(D4>=DATE(2026,1,1),DATEVALUE("28.2.2026"))))
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Could you please advise me how to make the correct formula?
When the date is changed according to the formula, the result does not change
Thank you
Zošit2
ABCDEF
1
2
3
422.12.2024
5
628.02.2024
7
8
9
10
11
Hárok1
Cell Formulas
RangeFormula
D4D4=TODAY()
D6D6=IF(D4>=DATE(2024,2,28),DATEVALUE("28.2.2024"),IF(D4>=DATE(2025,1,1),DATEVALUE("1.1.2025"),IF(D4>=DATE(2026,1,1),DATEVALUE("28.2.2026"))))
Try this. I have reversed your formula.

If the date is prior to 28/02/2024 what date do you want to be displayed?
If have inserted today's date but you may need to change this.

Excel Formula:
=IF($D$4>=DATE(2026,1,1),DATE(2026,2,28),IF($D$4>=DATE(2025,1,1),DATE(2025,1,1),IF($D$4>=DATE(2024,2,28),DATE(2024,2,28),TODAY())))
 
Upvote 0
Solution
T202412a.xlsm
DEFGH
1Date
2
3
421-Dec-24
528-Feb-2428-Feb-24
628-Feb-2428-Feb-241-Jan-251-Jan-25
71-Jan-2628-Feb-26
8
4c
Cell Formulas
RangeFormula
D4D4=TODAY()
D6D6=IF(D4>=DATE(2026,1,1),DATE(2026,2,28),IF(D4>=DATE(2025,1,1),DATE(2025,1,1),IF(D4>=DATE(2024,2,28),DATE(2024,2,28))))
E6E6=LOOKUP(D4,G5:H7)
 
Upvote 0
T202412a.xlsm
DEFGH
1Date
2
3
421-Dec-24
528-Feb-2428-Feb-24
628-Feb-2428-Feb-241-Jan-251-Jan-25
71-Jan-2628-Feb-26
8
4c
Cell Formulas
RangeFormula
D4D4=TODAY()
D6D6=IF(D4>=DATE(2026,1,1),DATE(2026,2,28),IF(D4>=DATE(2025,1,1),DATE(2025,1,1),IF(D4>=DATE(2024,2,28),DATE(2024,2,28))))
E6E6=LOOKUP(D4,G5:H7)
@HighAndWilder
@Dave Patton
it's ok!
thank you very much for your help.
so in the formula the dates must be written in descending order?
And you need to consider what result you want when none of the conditions apply.
 
Upvote 0
The if statement stops when it finds a true condition so if you are using D4>=a date then you need it to be in descending order. Think of it as setting the bar high and then gradually lowering it until you have captured all your options.
If you are using D4<=a date, you want to go in ascending order. ie set the bar low and keep raising it until you have captured all the options.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

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