Zad1107a

New Member
Joined
Oct 25, 2019
Messages
7
Hi everyone,
Im trying to go above and beyond by making an inventory sheet for work. I want excel to highlight the expiration dates of items that will expire in less than 30 days but I have no idea to write the formula(s). If I write out what I want to have happen it looks something like this: IF(Date-Today)=<30 then highlight.

Thanks in advance!!
 
Ah, I think I have it backwards. If these are future dates, we should be subtracting the current date from the existing date (sometimes it really helps to see the examples!).
So try switching those values around, i.e.
Code:
=D12-TODAY()<=30
Note that if you may have some blank values in column D that you do NOT want highlighted, we will need to add another check, i.e.
Code:
=AND(D12>0,D12-TODAY()<=30)

that did it thank you!!!
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Regarding the follow-up you sent in your PM to me:
In that example I provided I had to remove some text in order to get the formula to work. Several of the medications I am inventorying have multiple quantities with the same expiration date. Originally I had the quantities included in the cell ie: 10/25/2019 (x2). I simply moved them over to where I had the overall quantity of that specific drug but now I'm running into the same problem when I'm trying to make a formula to highlight when the required amount is less than the current stock. Ideally I would like to keep the quantity with that particular expiration with the dates for ease of use. Is there anyway I can have the formula ignore "(x2)"

Assuming that all entries have the format "Date Space Quanity", try this:
Code:
=AND(D12<>"",DATEVALUE(LEFT(D12,FIND(" ",D12)-1))-TODAY()<=30)
 
Upvote 0
Regarding the follow-up you sent in your PM to me:


Assuming that all entries have the format "Date Space Quanity", try this:
Code:
=AND(D12<>"",DATEVALUE(LEFT(D12,FIND(" ",D12)-1))-TODAY()<=30)

Thanks for the reply, didn't see the notification in my email. The exact way I would prefer to document the quantities specific to an expiration date would be: Expiration date (xQuantity.) Example 11/2/2019 (x2) indicating that there are two units that expire on 11/2/2019 (with the remaining units expiring on a different date.)
 
Upvote 0
Thanks for the reply, didn't see the notification in my email. The exact way I would prefer to document the quantities specific to an expiration date would be: Expiration date (xQuantity.) Example 11/2/2019 (x2) indicating that there are two units that expire on 11/2/2019 (with the remaining units expiring on a different date.)
I am not sure I undersrtand what you are saying. My solution should work for an entry like: 11/2/2019 (x2)
 
Upvote 0

Forum statistics

Threads
1,214,822
Messages
6,121,772
Members
449,049
Latest member
greyangel23

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