+ Reply to Thread
Results 1 to 19 of 19

Birthday reminder formula problem

  1. #1
    Registered User
    Join Date
    04-01-2010
    Location
    Chester-le-Street, England
    MS-Off Ver
    Excel 2016
    Posts
    91

    Birthday reminder formula problem

    I am getting blocked by this simple problem in a worksheet under construction with the objective to give a countdown to my relatives' birthday dates.

    I want a formula to output for example "10" (as a positive number) when the birthday was on 5th May 2009 and the current date is (say) 25 April 2015. The difficulty comes when I want the formula to activate no more than 30 days in advance. I have been trying all combinations of the usual stacked if(), month() and day() functions but to no avail. Can anyone help? Tks

  2. #2
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    606

    Re: Birthday reminder formula problem

    With the date in question in Cell A1:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-01-2010
    Location
    Chester-le-Street, England
    MS-Off Ver
    Excel 2016
    Posts
    91

    Re: Birthday reminder formula problem

    Thanks, it looks like I couldn't see the wood for the trees (common experience). I will insert your solution into my "environment" and report back on the result ..

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Birthday reminder formula problem

    If A1 contains the date of birth, then you will need to change the date to this year within the formula, i.e.:

    DATE(YEAR(TODAY()),MONTH(A1),DAY(A1))

    instead of just A1.

    Hope this helps.

    Pete

  5. #5
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    606

    Re: Birthday reminder formula problem

    Good call Pete, thank you for picking up that mistake.

  6. #6
    Registered User
    Join Date
    04-01-2010
    Location
    Chester-le-Street, England
    MS-Off Ver
    Excel 2016
    Posts
    91

    Re: Birthday reminder formula problem

    Thanks for both contributions but I'm afraid that I am still a lap behind you...

    In my spreadsheet cell C1 contains today's date i.e. =today(). For the sake of debugging I have temporarily / arbitrarily changed it to 18 Oct 2015
    The date of birth is set at 29 Oct 2009, in cell B7
    The "remaining time alert" is in cell D7 and this is the formula that I ended up with which half works
    =IF(MONTH(B7)=MONTH($C$1),IF(DAY($C$1)<=DAY(B7),DAY(B7)-DAY($C$1),""))
    It seems to work within the month in question (Oct) when the current day-date is approaching the birth-day-date, as above. But it fails if for example the original birthday was 5th Sept 2009 and the current date is 29th August 2015 (for example). In other words when I am asking it to "bridge" two successive months.
    I have been trying so far without huge success to incorporate your suggestions into mine, or alternatively to combine and substitute them altogether! I fear that some additional help will be necessary to get me over the hump please.

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Birthday reminder formula problem

    Okay, put this in D7:

    =IF(AND(DATE(YEAR($C$1),MONTH(B7),DAY(B7))-$C$1<31,DATE(YEAR($C$1),MONTH(B7),DAY(B7))-$C$1>0),DATE(YEAR($C$1),MONTH(B7),DAY(B7))-$C$1,"")

    This is a combination of Beamer's formula with my correction, adjusted to suit your data layout, and should cope with all date ranges.

    Hope this helps.

    Pete

  8. #8
    Registered User
    Join Date
    04-01-2010
    Location
    Chester-le-Street, England
    MS-Off Ver
    Excel 2016
    Posts
    91

    Thumbs up Re: Birthday reminder formula problem

    Hi Pete

    Great that seems to be the fix at last many thanks. I doubt if I could have got there myself unaided. Long live the Excel Help forum!

    Iain

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Birthday reminder formula problem

    You're welcome, Iain - thanks for feeding back.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  10. #10
    Registered User
    Join Date
    04-01-2010
    Location
    Chester-le-Street, England
    MS-Off Ver
    Excel 2016
    Posts
    91

    Re: Birthday reminder formula problem

    Have done ..

  11. #11
    Registered User
    Join Date
    04-01-2010
    Location
    Chester-le-Street, England
    MS-Off Ver
    Excel 2016
    Posts
    91

    Re: Birthday reminder formula problem

    And one day I'll sus out the logic behind the formula in its latest form!

  12. #12
    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: Birthday reminder formula problem

    Here's the logic:
    If the date calculated by (today's year, month of birthday, day of birthday) is less than 31 days away and more than 0 days away, then subtract today's date from that date to give a number, otherwise return blank ("").

    There are only two problems with this formula - one minor, one major. The minor one is that when you get to the birthday being today, it returns blank - you might want it to actually tell you that the birthday is today . The major one is that if the birthday is in January and today is December, it doesn't work as the years don't match.

    The solution to the first is quite simple - first check if the calculated date minus today's date equals 0, like this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The solution to the second is to insert another IF to check if 'today' ($C$1) is in month 12 (december) and if so to add a year to that date in the calculations - giving us the final formula of:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The logic of the final formula is:
    If the date calculated by (today's year, month of birthday, day of birthday) is the same as today's date, return 'Birthday!'. That's this bit:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If today's date is in December and (next year, month and day of birthday) is <31 and >0 days away, subtract today's date from that date to give the number of days remaining. That's this next bit:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If (today's year, month and day of birthday) is <31 and >0 days away, subtract today's date from that date to give the number of days remaining. That's the (almost) last bit:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Finally, if none of the above are true, return blank, then close off the formula with three brackets because there are three IF statements:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I hope the final formula is useful and that the explanation helps a bit.

    Happy New Year!

    Edit:
    To check for today = birthday, you could use this instead which just checks that the day and month of the birthday are the same as the day and month today:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    which would give you a final formula of:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    There's no difference in the result.

    Lastly, you could replace all the $C$1 references with TODAY() (for example YEAR($C$1) would become YEAR(TODAY()) instead) if you wanted to get rid of the cell containing today's date. The easiest way to do this would be to use Find and Replace. But personally, I'd probably leave it there!
    Last edited by Aardigspook; 01-01-2016 at 05:21 AM. Reason: Add alternative for part of formula
    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.

  13. #13
    Registered User
    Join Date
    04-01-2010
    Location
    Chester-le-Street, England
    MS-Off Ver
    Excel 2016
    Posts
    91

    Re: Birthday reminder formula problem

    Many thanks for your work over Hogmanay - not expected. It gets quite complex so I want to limit myself for now to solving the "minor" problem. I agree that unlike with my original formula the latest revision does not "show" when the current day-date is the same as the birthday-day-date which is the intention. The problem is that when I cut & paste your formulas into my spreadsheet I am getting just "#VALUE!" Something ain't quite right yet and I fear that it will take more than 5 minutes debugging to sus out just what ..

  14. #14
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Birthday reminder formula problem

    Aardigspook's formulae referred to a date in cell B5, not in B7, so the easiest thing to do is to copy them into D5 (where you might still get an error if B5 does not contain a date of birth), and then copy into D7.

    Happy New Year.

    Hope this helps.

    Pete

  15. #15
    Registered User
    Join Date
    04-01-2010
    Location
    Chester-le-Street, England
    MS-Off Ver
    Excel 2016
    Posts
    91

    Re: Birthday reminder formula problem

    Yup, the thought occurred that it might be a case of me simply getting the cell refs wrong in my spreadsheet and that was / is going to be my first line of investigation once the effects of last night have worn off. Tks.

  16. #16
    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: Birthday reminder formula problem

    Quote Originally Posted by Telegraph Sam View Post
    Many thanks for your work over Hogmanay - not expected
    You're welcome - I'm meant to be doing actual work, but doing a bit of procrastinating...

    Quote Originally Posted by Pete_UK View Post
    Aardigspook's formulae referred to a date in cell B5, not in B7
    Oops

    I started off with a date in B7, but then during testing extended up and down a bit, so ended up referring to B5 - sorry!

    Here are the two options with the correct ref:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Aardigspook; 01-01-2016 at 09:34 AM. Reason: Add corrected formulae

  17. #17
    Registered User
    Join Date
    04-01-2010
    Location
    Chester-le-Street, England
    MS-Off Ver
    Excel 2016
    Posts
    91

    Re: Birthday reminder formula problem

    Thanks that seems to have done the trick - I have just substituted 0 in place of "Birthday!" to get it to fit in with my spreadsheet format. Unless of course it turns out that I do need the more complicated change-year formula at which point the process gets repeated!

    A good start to 2016 and a HNY to both of you

    PS I have had to log in 3 x in order to send this reply so don't know if my previous credits got passed through or not.

  18. #18
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Birthday reminder formula problem

    Yes, thanks for the rep (both of them).

    Pete

  19. #19
    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: Birthday reminder formula problem

    Glad you got it working, thanks for the rep (x 2) and a Good New Year to you too.

+ 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] Automatic Email or Reminder When Birthday is Approaching
    By jebindavidson in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-08-2016, 08:59 AM
  2. Macro to send birthday reminder via outlook email
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-01-2014, 10:29 AM
  3. Birthday and work anniversary reminder from excel file to outlook email
    By paulbochniak in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-03-2014, 09:21 PM
  4. Birthday reminder
    By Desciplejustin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-16-2013, 11:48 AM
  5. Birthday Problem Simulation
    By wawar05 in forum Excel General
    Replies: 1
    Last Post: 09-09-2011, 10:25 PM
  6. wish to make a Birthday reminder!!
    By kiran1810 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-08-2011, 03:10 AM
  7. Getting problem in reminder for assigned tasks
    By champs in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 06-27-2009, 05:59 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