+ Reply to Thread
Results 1 to 4 of 4

Calculating Birthdays in the last 30 days

  1. #1
    Registered User
    Join Date
    01-18-2015
    Location
    London
    MS-Off Ver
    2007
    Posts
    2

    Calculating Birthdays in the last 30 days

    Hi,

    I want excel to alert me if the birthday of my clients was within the last 30 days. I am using the formula

    =IF(MONTH(K36)<>MONTH(TODAY())," ",IF(DAY(K36)>DAY(TODAY()-30)," ","Happy Birthday"))


    This formula is working to a certain extent but not working when the year changes. For example it works if the date of birth is 10/01/1980 (the month is same as this one January) and but not if the birthday is 30/12/1980 which is also 30 days prior to today (18/01/2015).

    The cell contains actual dates of birth e.g. 01/01/1980, 12/10/2000 etc

    I also have another problem where some of the people don't have an entry against their DoB field and if it is blank it give a false alert that it is their birthday and if it has a hyphen (-) in the cell it give a #value! alert. How can I solve this?

    Could you please help. Thanks in advance

    PS: Would this formula work in conditional formatting too.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculating Birthdays in the last 30 days

    Try using DATEDIF function like this

    =IFERROR(IF(K36="","",IF(DATEDIF(K36,TODAY(),"yd")<=30,"Happy Birthday","")),"")

    If K36 is blank or "-" (or any other text value) then the formula returns a blank
    Audere est facere

  3. #3
    Registered User
    Join Date
    01-18-2015
    Location
    London
    MS-Off Ver
    2007
    Posts
    2

    Re: Calculating Birthdays in the last 30 days

    Thanks a lot for the quick response Daddylonglegs, really appreciate it.


    This formula works perfectly.

    Would I be able to use the same formula in conditional formatting too?

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculating Birthdays in the last 30 days

    If you want to highlight the Birthday dates here it would probably be simpler just to use the "Happy Birthday" text as a "trigger", or if you want that separately just use this formula in CF

    =AND(DATEDIF(K36,TODAY(),"yd")<=30,K36<>"")

+ 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. Replies: 0
    Last Post: 10-31-2014, 10:32 AM
  2. Replies: 2
    Last Post: 02-20-2014, 06:40 AM
  3. Calculating time elapsed in days and count days within same range
    By michellem410 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-19-2008, 01:13 PM
  4. [SOLVED] Calculating recurring date in following month, calculating # days in that period
    By Walterius in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-05-2005, 11:05 PM
  5. [SOLVED] Calculating recurring date in following month, calculating # days in that period
    By Walterius in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-04-2005, 07:05 PM

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