+ Reply to Thread
Results 1 to 22 of 22

Add All Numbers in a Single Cell

  1. #1
    Forum Contributor
    Join Date
    01-15-2015
    Location
    philippines
    MS-Off Ver
    Excel 365
    Posts
    116

    Add All Numbers in a Single Cell

    Hi Guys,

    I need your help with a formula. Not VBA. I have a single column of upto 100 rows that contains entries that are alphanumeric and sometimes with symbols.
    I would like to add all the numbers that are present in every single entry. One entry is one cell.
    Each entry may look like any of the following placed in A1, A2, and so on:

    1. Big(1)small(2)big(2)big(1)
    2. Carmen14Sarah0Naomi1
    3. Big[1]small(2)
    4. Big2Big3Medium(2)
    5. Color24Big[2]Big[1]

    So that if the numbers are added. The result would be:

    1. 6
    2. 15
    3. 3
    4. 7
    5. 27

    Thank you so much.
    Last edited by AliGW; 07-18-2018 at 06:22 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Add All Digits in a Single Cell

    I'm pretty certain that you will need VBA to run a UDF to do this. I can show you how... but if you mean NO VBA... I can only do this with single digit numbers.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Add All Digits in a Single Cell

    this is a monster array formula:

    Big(1)small(2)big(2)big(1)
    6
    {=SUMPRODUCT(1*MID(MID(INT(NPV(-0.9,IFERROR(MID(A1,1+LEN(A1)-ROW(INDIRECT("1:"&LEN(A1))),1)/10,""))),1,LEN(A1)),ROW(INDIRECT("1:"&LEN(MID(INT(NPV(-0.9,IFERROR(MID(A1,1+LEN(A1)-ROW(INDIRECT("1:"&LEN(A1))),1)/10,""))),1,LEN(A1))))),1))}
    Carmen14Sarah0Naomi1
    6
    Big[1]small(2)
    3
    Big2Big3Medium(2)
    7
    Color24Big[2]Big[1]
    9


    btw. digits: 0,1,2,3,4,5,6,7,8,9 and nothing more
    Last edited by sandy666; 07-18-2018 at 06:01 AM.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Add All Digits in a Single Cell

    There's a much simpler one to add single digits. But in this case, it won't do as the 14 in Carmen14..... counts as 14, not as 1 and 4.

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Add All Digits in a Single Cell

    Hi Glenn,
    what about title? Add All Digits in a Single Cell

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Add All Digits in a Single Cell

    See the expected answers in Post 1...

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Add All Digits in a Single Cell

    so something is wrong - or title or expected answer
    that is why is btw in my post

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,418

    Re: Add All Digits in a Single Cell

    Once again, the requirement is clearly stated in the opening post, Sandy. The bits in red make it clear that it's whole numbers that are required:

    1. Big(1)small(2)big(2)big(1)
    2. Carmen14Sarah0Naomi1
    3. Big[1]small(2)
    4. Big2Big3Medium(2)
    5. Color24Big[2]Big[1]

    So that if the numbers are added. The result would be:

    1. 6
    2. 15
    3. 3
    4. 7
    5. 27
    However, on reflection, the title is a bit misleading - I will amend it to properly reflect what's needed here.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Forum Contributor
    Join Date
    01-15-2015
    Location
    philippines
    MS-Off Ver
    Excel 365
    Posts
    116

    Re: Add All Numbers in a Single Cell

    Hi guys,

    Thank you for looking into this. Im sorry if im giving you a hard time. I just dont know how to do it.
    Regarding the title, when I think of it. It does seem to be a little misleading. But Im sure you all get the picture.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Add All Numbers in a Single Cell

    What's the issue with VBA? It's the only way to do it.... 99.9% certain.

  11. #11
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Add All Numbers in a Single Cell

    Its VBA as the way, unless the other text in cells is from a finite list so the cell could be cleaned of brackets and big, small, medium , Carmen, Sarah, Naomi, and color could be replaced with +

    It would be a function, as a vba solution, so no code would need to be run by the user

  12. #12
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Add All Numbers in a Single Cell

    Cross-posted at: https://www.mrexcel.com/forum/excel-...ngle-cell.html
    Please read Excel Forum's Cross-Posting policy in rule 8: http://www.excelforum.com/forum-rule...rum-rules.html
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  13. #13
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Add All Numbers in a Single Cell

    Brute Force way (with helper sheet) but I really suggest vba

  14. #14
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Add All Numbers in a Single Cell

    Here is with array formula (long one).
    Formula must be entered with Ctrl+Shift+Enter

    Please Login or Register  to view this content.
    v A B
    1 Big(1)small(2)big(2)big(1) 6
    2 Carmen14Sarah0Naomi1 15
    3 Big[1]small(2) 3
    4 Big2Big3Medium(2) 7
    5 Color24Big[2]Big[1] 27
    Attached Files Attached Files
    Last edited by AliGW; 07-19-2018 at 02:48 AM. Reason: Formula added to body of post.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Add All Numbers in a Single Cell

    Hahaha. I had gone through the multiple substitutes, but had got stuck converting the array back into a summable string...

  16. #16
    Forum Contributor
    Join Date
    10-30-2003
    Location
    Singapore
    MS-Off Ver
    Excel 2019
    Posts
    197

    Re: Add All Numbers in a Single Cell

    Maybe…….

    Try this non-array shorter formula

    In B1, copied down :

    =SUMPRODUCT(TEXT(0&LEFT(TEXT(MID(A1&"a",ROW($1:$99),COLUMN(A:O)),),COLUMN(A:O)-1),"0;0;0;\0")*ISERR(-MID(A1,ROW($1:$99)-1,2)))

    Bosco

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Add All Numbers in a Single Cell

    Where did you dream that one up, Bosco??? Inspired...

  18. #18
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Add All Numbers in a Single Cell

    Really nice, Bosco
    what about:
    Please Login or Register  to view this content.
    Result: 1500
    (English keyboard only)
    Last edited by sandy666; 07-19-2018 at 10:42 AM.

  19. #19
    Forum Contributor
    Join Date
    10-30-2003
    Location
    Singapore
    MS-Off Ver
    Excel 2019
    Posts
    197

    Re: Add All Numbers in a Single Cell

    Good question, I know already some special sign the post #.16 formula can't work

    then, try this formula in B1 instead

    =SUMPRODUCT(--(0&MID(A1,ROW($1:$100),TEXT(FREQUENCY(-ROW($1:$99),-ISERR(-MID(0&A1,ROW($1:$99),1))*ROW($1:$99))-1,"[<]\0"))))

    Result =1500

    Regards
    Bosco

  20. #20
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Add All Numbers in a Single Cell

    WOW! really impressive

    edit: it works even with arabic characters ! جمهوری اسلامی5 ایرانx1b4

    I bow low and thank you
    Last edited by sandy666; 07-19-2018 at 11:41 AM.

  21. #21
    Forum Contributor
    Join Date
    01-15-2015
    Location
    philippines
    MS-Off Ver
    Excel 365
    Posts
    116

    Re: Add All Numbers in a Single Cell

    Wow! Thanks guys. I have been away for a while on a vacation.
    I got to say many thanks to all. The amount of creativity and wit is insane.

  22. #22
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Add All Numbers in a Single Cell

    @Bosco ... WOW!

    When I try to figure this one out will it cause nightmares? LOL
    Dave

+ 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] How to subtract single cells with double digits into a single digit of a single cell.
    By greenfox74 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-11-2021, 02:05 AM
  2. is there a way to add single digits within a single cell?
    By ceci in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  3. [SOLVED] is there a way to add single digits within a single cell?
    By ceci in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  4. [SOLVED] is there a way to add single digits within a single cell?
    By Bernard Liengme in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  5. is there a way to add single digits within a single cell?
    By Bernard Liengme in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM
  6. is there a way to add single digits within a single cell?
    By ceci in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. is there a way to add single digits within a single cell?
    By ceci in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  8. [SOLVED] is there a way to add single digits within a single cell?
    By ceci in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-18-2005, 04: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