+ Reply to Thread
Results 1 to 23 of 23

Need Formula for Calculating Expiry Date of Items

Hybrid View

sweetfriend9 Need Formula for Calculating... 07-12-2016, 08:53 AM
AliGW Re: Need Formula for... 07-12-2016, 09:29 AM
sweetfriend9 Re: Need Formula for... 07-12-2016, 09:49 AM
AliGW Re: Need Formula for... 07-12-2016, 09:31 AM
sweetfriend9 Re: Need Formula for... 07-12-2016, 09:52 AM
AliGW Re: Need Formula for... 07-12-2016, 09:55 AM
FDibbins Re: Need Formula for... 07-12-2016, 10:04 AM
sweetfriend9 Re: Need Formula for... 07-12-2016, 11:46 AM
AliGW Re: Need Formula for... 07-12-2016, 11:48 AM
sweetfriend9 Re: Need Formula for... 07-12-2016, 11:51 AM
AliGW Re: Need Formula for... 07-12-2016, 11:56 AM
sweetfriend9 Re: Need Formula for... 07-12-2016, 12:04 PM
AliGW Re: Need Formula for... 07-12-2016, 12:05 PM
Aardigspook Re: Need Formula for... 07-12-2016, 12:07 PM
sweetfriend9 Re: Need Formula for... 07-12-2016, 12:11 PM
AliGW Re: Need Formula for... 07-12-2016, 12:30 PM
Aardigspook Re: Need Formula for... 07-13-2016, 03:40 AM
Phuocam Re: Need Formula for... 07-13-2016, 04:32 AM
sweetfriend9 Re: Need Formula for... 07-13-2016, 05:32 AM
Aardigspook Re: Need Formula for... 07-13-2016, 05:57 AM
Phuocam Re: Need Formula for... 07-13-2016, 06:30 AM
sweetfriend9 Re: Need Formula for... 07-13-2016, 07:53 AM
Phuocam Re: Need Formula for... 07-13-2016, 08:09 AM
  1. #1
    Registered User
    Join Date
    08-27-2015
    Location
    india
    MS-Off Ver
    2013
    Posts
    58

    Need Formula for Calculating Expiry Date of Items

    I need formula for calculating the expiry dates as mentioned in the attached sheet .
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,482

    Re: Need Formula for Calculating Expiry Date of Items

    So, what is the calculation that you wish to perform? How long after the best before date do items expire?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-27-2015
    Location
    india
    MS-Off Ver
    2013
    Posts
    58

    Re: Need Formula for Calculating Expiry Date of Items

    pls see the attachment ( manual calculation done )
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,482

    Re: Need Formula for Calculating Expiry Date of Items

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

  5. #5
    Registered User
    Join Date
    08-27-2015
    Location
    india
    MS-Off Ver
    2013
    Posts
    58

    Re: Need Formula for Calculating Expiry Date of Items

    will take care of the multiple posts in future , thanks for the reminder

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,482

    Re: Need Formula for Calculating Expiry Date of Items

    Quote Originally Posted by sweetfriend9 View Post
    will take care of the multiple posts in future , thanks for the reminder
    You need to take care of it this time, too, please. If your problem has been solved elsewhere, then you need to say so and mark the thread as solved so that nobody ends up wasting their time.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Need Formula for Calculating Expiry Date of Items

    Please provide the link to your x-post. The other web site will also require you to do this
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  8. #8
    Registered User
    Join Date
    08-27-2015
    Location
    india
    MS-Off Ver
    2013
    Posts
    58

    Re: Need Formula for Calculating Expiry Date of Items

    My query isnt solved yet , pls help

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,482

    Re: Need Formula for Calculating Expiry Date of Items

    Quote Originally Posted by sweetfriend9 View Post
    My query isnt solved yet , pls help
    You have not yet provided a link to posts that you have made on other forums. When you have done that, one of us will help.

  10. #10
    Registered User
    Join Date
    08-27-2015
    Location
    india
    MS-Off Ver
    2013
    Posts
    58

    Re: Need Formula for Calculating Expiry Date of Items

    If you are happy helping me then its okay , i havent posted it anywhere

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,482

    Re: Need Formula for Calculating Expiry Date of Items

    Quote Originally Posted by sweetfriend9 View Post
    If you are happy helping me then its okay , i havent posted it anywhere
    You have posted exactly the same query on another forum under the name of warsisalman. Please provide a link to that thread.

  12. #12
    Registered User
    Join Date
    08-27-2015
    Location
    india
    MS-Off Ver
    2013
    Posts
    58

    Re: Need Formula for Calculating Expiry Date of Items

    ask the admin to block me here

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,482

    Re: Need Formula for Calculating Expiry Date of Items

    Quote Originally Posted by sweetfriend9 View Post
    ask the admin to block me here
    Why not just provide the link requested? If you do that, you will get help.

  14. #14
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Need Formula for Calculating Expiry Date of Items

    @sweetfriend9
    I can give you a possible solution, but please comply with Rule 8 first - just post a link to your thread on the other site. Once you've done that, you'll find folk are much more willing to help you.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  15. #15
    Registered User
    Join Date
    08-27-2015
    Location
    india
    MS-Off Ver
    2013
    Posts
    58

    Re: Need Formula for Calculating Expiry Date of Items

    help me or not take this one , i jumped onto the other forum coz i was not getting the solution here ... Thanks anyway

    http://www.mrexcel.com/forum/excel-q...iry-dates.html

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,482

    Re: Need Formula for Calculating Expiry Date of Items

    Thank you for the link. It was under half an hour between posting here and on the other forum. You have to understand that replies will not necessarily be instant. There is not a problem asking elsewhere as long as you give a link so that people here know. Hopefully Ardigspook will now offer you help.

  17. #17
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Need Formula for Calculating Expiry Date of Items

    As I understand your question, you want to have the expiry date equal to either: (1) the best before date if that's given or (2) the date of purchase/mfg plus the length of time given in the best-before-date column.
    This formula (in cell E2) will give you a good approximation of the expiry date:
    Formula: copy to clipboard
    =IF(ISNUMBER(D2),D2,IF(RIGHT(D2,6)="Months",C2+((365/12)*LEFT(D2,LEN(D2)-(LEN(D2)-FIND(" ",D2)))),IF(RIGHT(D2,5)="Years",C2+(365*LEFT(D2,LEN(D2)-(LEN(D2)-FIND(" ",D2)))),"nothing found")))

    It first checks if D2 is a number (Excel treats a date as a number). If so, it returns D2. That is, if D2 is a date, E2 = D2.
    Then it checks to see if D2 ends with 'Months'. If so, it finds the number of months (that's the LEFT(D2,LEN(D2)-(LEN(D2)-FIND(" ",D2))) bit), multiplies that by 365/12 (which gives an approximation of the number of days in a month), then adds that to the date in C2.
    Then it checks if D2 ends with 'Years'. If so, it finds the number of years and multiplies that by 365, then adds that to the date in C2.
    If no date is found in C2, 'nothing found' is returned - you can replace this with anything you want - use "" to return a blank.

    As you'll see, the date isn't 100% accurate for the '6 Months' and '1.5 Years'. It should be possible to make it accurate, but the formula will be a lot more complicated as it would need to take account of the number of months left in the year of the date in column C. I'd rather not start digging into that unless you really need it.

    Does the formula above work well enough for you?

  18. #18
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: Need Formula for Calculating Expiry Date of Items

    Or try this in cell E2 ...

    =IF(D2="","",IF(N(D2)>C2,D2,EDATE(C2,IF(COUNTIF(D2,"*Months*"),--SUBSTITUTE(D2," Months",""),12*SUBSTITUTE(D2," Years","")))))

    Copy down.

  19. #19
    Registered User
    Join Date
    08-27-2015
    Location
    india
    MS-Off Ver
    2013
    Posts
    58

    Re: Need Formula for Calculating Expiry Date of Items

    Thanks it worked , only slight change if possible , it's not working for Text = Month or Year

  20. #20
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Need Formula for Calculating Expiry Date of Items

    @Phuocam: much better than mine - I've had to create so many files for 2003 users that I always forget about EDATE!

    @sweetfriend9: Phuocam's formula amended to cope with Month/Months/Year/Years:
    Formula: copy to clipboard
    =IF(D5="","",IF(N(D5)>C5,D5,EDATE(C5,IF(COUNTIF(D5,"*Months*"),--SUBSTITUTE(D5," Months",""),IF(COUNTIF(D5,"*Month*"),--SUBSTITUTE(D5," Month",""),IF(COUNTIF(D5,"*Years*"),--SUBSTITUTE(D5," Years",""),12*SUBSTITUTE(D5," Year","")))))))

  21. #21
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: Need Formula for Calculating Expiry Date of Items

    Another way ...

    =IF(D2="","",IF(N(D2)>C2,D2,EDATE(C2,LOOKUP(10^10,--LEFT(D2,{1,2,3,4,5,6,7,8}))*IF(COUNTIF(D2,"*Month*"),1,12))))

  22. #22
    Registered User
    Join Date
    08-27-2015
    Location
    india
    MS-Off Ver
    2013
    Posts
    58

    Re: Need Formula for Calculating Expiry Date of Items

    Thanks ... You all are like ... what i want to be ...

  23. #23
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: Need Formula for Calculating Expiry Date of Items

    You are welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Help with formula to return a value based on if that expiry date is within year
    By mw91 in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 01-08-2015, 11:37 AM
  2. autocalculate expiry date / expiry date colour warnings
    By kimbling1 in forum Excel General
    Replies: 8
    Last Post: 08-27-2014, 02:53 AM
  3. Replies: 1
    Last Post: 08-14-2014, 02:32 AM
  4. Replies: 1
    Last Post: 09-29-2012, 02:24 PM
  5. Excel 2007 : expiry date formula issue
    By derweezy in forum Excel General
    Replies: 1
    Last Post: 03-16-2011, 02:51 PM
  6. Expiry date Formula & AutoFilter VBA
    By nasoor123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2010, 09:56 AM
  7. Calculating Expiry Dates
    By shinyell in forum Excel General
    Replies: 3
    Last Post: 10-19-2009, 03:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1