Formula to display text based on date range of another cell

iluvweed

New Member
Joined
May 24, 2018
Messages
10
Hello I am trying to use one cell to display 4 different lines of text based on the date of a single cell. Specifically what I am trying to do is have a cell display "30 days" if the date in another cell (B4) is within 30 days of TODAY. Once the date is within 60 days of TODAY I want it to read "60 days". Once the date is within 90 days of TODAY, I want it to read "90 days". Once 120 days have passed I don't know what I want it to read yet. Probably blank for now (""). I'm getting close on my own but not close enough. I cant add all 4 of these functions into a formula with my limited knowledge. Any insight would be very much appreciated! Thank you!!!
 

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.
is the date in the cell in the future or past

so if today is 28-nov
then 30 days in future - is that having the date 28/12/22 in the cell
OR
30 days in past is that having the date 29/10/22 in the cell

something like a nested if would do that

=IF( Cell -today() ) < 30 ,
OR
If(today() - cell ) <30 ,

But i'm not sure what within exactly means
 
Upvote 0
is the date in the cell in the future or past

so if today is 28-nov
then 30 days in future - is that having the date 28/12/22 in the cell
OR
30 days in past is that having the date 29/10/22 in the cell

something like a nested if would do that

=IF( Cell -today() ) < 30 ,
OR
If(today() - cell ) <30 ,

But i'm not sure what within exactly means
thank you for replying!
The date in B4 is a hire date for an employee. So would pretty much always be in the past. I want a cell to reflect if they are within their 30 days of hire (and then say 30), and then change when they are within 60 days and ultimately 90 days. Once the 90 are up the cell would change to at this point nothing because I want to utilize the cell to display a text I don't have a use for yet. I figured I just leave it blank for the time being. I will work now on what you gave me and hopefully that works for me.
 
Upvote 0
This is what I have been trying to make work for me, I think i'm getting close...

=IF(B4<TODAY()+30,"30",IF(B4<TODAY()+60,"60",IF(B4<TODAY()+90,”90”)))
 
Upvote 0
=IF((TODAY()-B4)>120, "over120",IF((TODAY()-B4)>90, "over90", IF((TODAY()-B4)>60, "over60",IF((TODAY()-B4)>30, "over30","under 30"))))

Book3
ABCD
1
2
3
45/13/22over120
56/2/22over120
66/22/22over120
77/12/22over120
88/1/22over120
98/21/22over90
109/10/22over60
119/30/22over60
1210/20/22over30
1311/9/22under 30
1411/29/22under 30
Sheet1
Cell Formulas
RangeFormula
D4:D14D4=IF((TODAY()-B4)>=120, "over120",IF((TODAY()-B4)>=90, "over90", IF((TODAY()-B4)>=60, "over60",IF((TODAY()-B4)>=30, "over30","under 30"))))


Book3
ABCDEF
1
2
3Example of days calc
45/13/22over120200
56/2/22over120180
66/22/22over120160
77/12/22over120140
88/1/22over120120
98/21/22over90100
109/10/22over6080
119/30/22over6060
1210/20/22over3040
1311/9/22under 3020
1411/29/22under 300
Sheet1
Cell Formulas
RangeFormula
D4:D14D4=IF((TODAY()-B4)>=120, "over120",IF((TODAY()-B4)>=90, "over90", IF((TODAY()-B4)>=60, "over60",IF((TODAY()-B4)>=30, "over30","under 30"))))
F4:F14F4=TODAY()-B4
 
Upvote 0
Solution
you are welcome
I was getting confused when i posted - if you wanted within 30,60,90,120

Anyway - I'll leave it in case

OR
if its within those days
how about

Book3
ABCDEF
1
2
3Example of days calc
45/13/22120 days or older200
56/2/22120 days or older180
66/22/22120 days or older160
77/12/22120 days or older140
88/1/22120 days or older120
98/21/22120 days100
109/10/2290 days80
119/30/2290 days60
1210/20/2260 days40
1311/9/2230 days20
1411/29/2230 days0
Sheet1
Cell Formulas
RangeFormula
D4:D14D4=IF((TODAY()-B4)<30, "30 days",IF((TODAY()-B4)<60, "60 days", IF((TODAY()-B4)<90, "90 days",IF((TODAY()-B4)<120, "120 days","120 days or older"))))
F4:F14F4=TODAY()-B4
 
Upvote 0
Ya I went through and just changed the text to "within" and it pretty much works exactly how I needed it. I'm sure I can fiddle with it more but on a time crunch and many other issues to figure out lol. But once again I really appreciate this very much. I looked for a link to send you a beer or a tea or something to show my gratitude but cant seem to find one on your profile, I don't come here very often so unsure if something like that exists. If it does though I'd appreciate the link. True life saver!
 
Upvote 0
and just changed the text to "within" and it pretty much works exactly
so long as the dates you want - do work correctly for you
BUT
Within sounds to me more like post 7
=IF((TODAY()-B4)<30, "within 30 days",IF((TODAY()-B4)<60, "Within 60 days", IF((TODAY()-B4)<90, "Within 90 days",IF((TODAY()-B4)<120, "Within 120 days","120 days or older"))))

Anyway so long as it does what you need with various dates tests ......

I looked for a link to send you a beer or a tea or something to show my gratitude
Thats very kind of you , no link for payment to a member or to the site as far as I know, This is a free volunteer site here , so thanks for the offer very kind.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,198
Members
452,616
Latest member
intern444

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