+ Reply to Thread
Results 1 to 7 of 7

Summing the digits of a date

  1. #1
    Registered User
    Join Date
    02-11-2013
    Location
    Los Angeles
    MS-Off Ver
    365
    Posts
    35

    Summing the digits of a date

    Hi, need help with a formula that will sum each digit of a date. For example, 9/22/2020, need a formula that will do the following...9+2+2+2+2=17

    Here is the formula i tried, but it does not work on dates. =SUMPRODUCT(1*MID(A3,ROW(INDIRECT("1:"&LEN(A3))),1))


    Any help will be greatly appreciated.

    BJW
    Last edited by MatrixFX; 09-22-2020 at 11:15 PM.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,458

    Re: Summing the digits of a date

    One way:

    Please Login or Register  to view this content.
    Quang PT

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,458

    Re: Summing the digits of a date

    Alternative:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-11-2013
    Location
    Los Angeles
    MS-Off Ver
    365
    Posts
    35

    Re: Summing the digits of a date

    Thanks for you help, but I am a little lost. I tried to copy and paste what you provided, starting with the = sign, but it did not work. Can you clarify pls.

  5. #5
    Registered User
    Join Date
    02-11-2013
    Location
    Los Angeles
    MS-Off Ver
    365
    Posts
    35

    Re: Summing the digits of a date

    Beboo, thank you for your help. The formula is working perfectly!

  6. #6
    Forum Contributor
    Join Date
    03-18-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2016 / 2019
    Posts
    251

    Re: Summing the digits of a date

    Hi MatrixFX

    A2 = 9/22/2020

    =SUM(VALUE(MID(VALUE(SUBSTITUTE(A2,"/",0)),ROW(A1:OFFSET(A1,LEN(VALUE(SUBSTITUTE(A2,"/",0)))-1,0)),1)))
    Christopher Yap

  7. #7
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Summing the digits of a date

    in VBA

    Please Login or Register  to view this content.
    Last edited by maniacb; 09-23-2020 at 12:19 AM. Reason: Corrections to response

+ 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: 4
    Last Post: 11-09-2017, 02:05 PM
  2. [SOLVED] Formula not "SUMMING" everything starting with same digits
    By Ochimus in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-31-2016, 09:34 PM
  3. Replies: 3
    Last Post: 12-05-2012, 11:03 PM
  4. Prompt if any value in col C <> 10 digits long or Col D <> date or..
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-08-2011, 02:32 PM
  5. Four Digits into a Date
    By dogfood411 in forum Excel General
    Replies: 12
    Last Post: 01-20-2009, 03:22 PM
  6. Summing date from multiple date format named worksheets
    By blackfrog4 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-02-2008, 05:10 PM
  7. [SOLVED] Convert string of digits into a date
    By Scott Lolmaugh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-23-2006, 05:43 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