IF Statement Greater than, Less Than + Math = text

maurialero

New Member
Joined
Dec 13, 2022
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hello Everyone,

I can't wrap my head around this one and I thought it was going to be simple....

Here is the issue:

Column A has an expiration date
Column B has the Todays formula. Why? I want the formula to tell me when an expiration is becoming due, is current or expired.

You can see I'm adding day formulas also. A little guidance will be appreciated.

I'm just comparing a column to a date not comparing two columns. Then I expect 3 different answers based on my conditions but it doesnt seems to work.

Example: =IF(A1-110<B1, "Take Action", IF(A1=B1, "Expired", IF(A1-365=B1, "Current"
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
How about this?
活頁簿3
ABCD
1Expiration TodayRemarkNote
22022/12/132022/12/13Expiredequal to today
32022/12/122022/12/13Expiredlater than today
42022/12/142022/12/13Take Actionearlier than today under 110 days
52023/4/12022/12/13Take Actionearlier than today under 110 days
62023/4/22022/12/13Take Actionearlier than today under 110 days
72023/4/32022/12/13Currentearlier than today over 110 days
工作表1
Cell Formulas
RangeFormula
A2A2=B2
B2:B7B2=TODAY()
C2:C7C2=IF(A2<=B2,"Expired",IF(A2>B2+110,"Current","Take Action"))
A3A3=B3-1
A4A4=B4+1
A5A5=B5+109
A6A6=B6+110
A7A7=B7+111
 
Upvote 0
This is awesome! Maybe I'm not as good with Excel as I thought but let me ask something else please. It seems that it works but the problem is that the math in embeded basically what I'm looking for is a shell formula.

Example:

I open my spreadsheet and in one cell out of the view the formula =Today() automatically refreshes.

Now the new report I will paste has:
Work order numbers
Fr1 - Exp date
Fr2 - Exp date
Fr3 - Exp date
Etc.. in a sequencial waterfall order.

Now column 3 has my formula I just copy paste and drag down. In other words the calculations have to happen withinn the formula as opposed to be added to the dates.
 
Upvote 0
So what is your need ?
I can't understand your needs clearly.
 
Upvote 0
Cant seem to be able but here is the formula:

=IF($E10-110<=$N$1,"Expired","Current")

Column A =
7/1/2023

Column B = Result from formula

Column C (In only one cell) =Today()
 
Upvote 0
I am wondering if you are misreading HongRu's XL2BB.
The formula in Column A are purely to produce representative sample dates, they are not part of the calculation.
The XL2BB has the formula in Column C with column B just repeating Today(), so you can put the formula in Column B and change any references to column B with the Cell you have containg Today().
The Check Columns is just informational to help check the logic.

Book1
ABCDEFG
1Expiration RemarkNoteCheck Only Days since todayDate To Use13/12/2022
213/12/2022Expired0
312/12/2022Expired-1
414/12/2022Take Action1
51/04/2023Take Action109
62/04/2023Take Action110
73/04/2023Current111
Modified
Cell Formulas
RangeFormula
B2:B7B2=IF(A2>($G$1+110),"Current",IF(A2>$G$1,"Take Action","Expired"))
D2:D7D2=A2-$G$1
 
Last edited:
Upvote 0
Omg you might be right!. First time is use the forum and not familiar with all the features wanted to upload my spreadsheet but didnt work.

This is a great Foroum. I just wish and maybe you can elaborate on this one. Why is it that I didnt do properly? It seems I was missing a lot of elements in my formula.
 
Upvote 0
I am not if this will help but lets give it a go.
When you are trying to group numbers (which includes dates) into number ranges, it works best if you do your if statements in order, descending or ascending order.
That way the next if statement is effectively saying BETWEEN.,

20221213 If Date grouping maurialero.xlsx
AB
1NumbersGrouping
210Under 21
320Under 21
43021-50
54021-50
65021-50
710051-200
820051-200
9300>200
Sample
Cell Formulas
RangeFormula
B2:B9B2=IF(A2>200,">200", IF(A2>50,"51-200", IF(A2>20,"21-50", "Under 21")))
 
Upvote 0
Yes it does help!. Also I noticed the heriarchy or closing the math between parenthesis.

Another thing it seems that my math was wrong I was trying to do the math within the exp date like this:
A1
7/23/2024

B1
=IF(A1-100<=C1, "Take Action", "Expired")

C1
=Today()

My formula was to simple. I live Excel hopefully I can find good tutoring here or books that help you with nested formulas. I'm interested in the why? As much as the how? 🙂

Great help here.
 
Upvote 0

Forum statistics

Threads
1,214,874
Messages
6,122,034
Members
449,061
Latest member
TheRealJoaquin

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