Results 1 to 14 of 14

Thread: [RESOLVED] ages

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    110

    Resolved [RESOLVED] ages

    in excel i am using this formula to work out someones age,

    =INT($B$2-C11)/365.25
    where $b$2 is todays date and c11 is the DOB

    but it rounds it up so if they are 15 and a half it puts that they are sixteen, how can i force excel to round down.

    thanks
    joe

  2. #2
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: ages

    Use this formula:

    Code:
    =IF(MONTH(C11)<MONTH($B$2);YEAR(C11)-YEAR($B$2)-1;IF(MONTH(C11)=MONTH($B$2);IF(DAY(C11)>=DAY($B$2);YEAR(C11)-YEAR($B$2)-1;YEAR(C11)-YEAR($B$2))))
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  3. #3
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: ages

    Or:

    =INT(($B$2-C11+1)/365.25)
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    110

    Re: ages

    i have tried both of these methods and neither of them seem to work, am i doing something wrong?

    any other suggestion?

    thanks joe

  5. #5
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: ages

    My one works for me. How does yours not work? Give an example of what you have put in the cells.
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    110

    Re: ages

    sorry i have got it to work now thanks

  7. #7
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: ages

    in excel i am using this formula to work out someones age,

    =INT($B$2-C11)/365.25
    where $b$2 is todays date and c11 is the DOB

    but it rounds it up so if they are 15 and a half it puts that they are sixteen, how can i force excel to round down.

    thanks
    joe
    Hi Joe

    You can also use the above formula as

    =INT((TODAY()-C11)/365.25)

    Where C11 is the DOB and Today() gives you todays date...

    Even in my case Excel rounds 15.5 to 15

    Just try this in any cell and tell me what do you get?

    =INT(15.5)
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    110

    Re: [RESOLVED] ages

    yeh it rounds down but i have got it sorted now, thanks alot anyway.

    thanksalot everyone

    joe

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    110

    Re: [RESOLVED] ages

    i used this code and just copied it down into everycell,

    Code:
    =IF(C11="","",INT(($B$2-C11+1)/365.25))

  10. #10
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: [RESOLVED] ages

    Here is an accurate way to find the DOB

    =DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months, " & DATEDIF(A1,NOW(),"md") & " days"

    A1 = DOB
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    110

    Re: [RESOLVED] ages

    why would you want to get somebodys date of birth though from their age, because nobody knows how old they are exactly, or am i not understanding it right?

  12. #12
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: [RESOLVED] ages

    Here is an accurate way to find the DOB
    sorry that's a typo...

    It should be

    Here is an accurate way to find the Age
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    110

    Re: [RESOLVED] ages

    so how is it more accurate than

    Code:
    INT(($B$2-C12+1)/365.25)
    as this seems to work fine?
    or does yours return their age in years, months and days?

  14. #14
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: [RESOLVED] ages

    as this seems to work fine?
    or does yours return their age in years, months and days?
    Yes it does
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

Posting Permissions

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



Click Here to Expand Forum to Full Width