+ Reply to Thread
Results 1 to 6 of 6

Summing Numbers in Cells Including Consecutive Numbers

  1. #1
    Registered User
    Join Date
    04-07-2024
    Location
    United Kingdom
    MS-Off Ver
    365 v2401
    Posts
    3

    Summing Numbers in Cells Including Consecutive Numbers

    Hi All,

    I want to take a cell (A1) with a value such as "M12G3" and sum the values of these numbers. The answer to this problem would be 15 (12+3) and not 6 (1+2+3)

    I got as far as [=SUM(IFERROR(VALUE(MID(A1,SEQUENCE(LEN(A1)),1)),0))]. This gives the incorrect answer and cant handle consecutive numbers :(.

    This solution can't use vba/macros. I'm not sure where to go from here
    Last edited by NeilsonWheels; 04-07-2024 at 12:12 PM.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,760

    Re: Summing Numbers in Cells Including Consecutive Numbers

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

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,656

    Re: Summing Numbers in Cells Including Consecutive Numbers

    Welcome to the forum.

    What exactly do you mean by 'consecutive numbers'? Can you give an example?

    If you mean that something like M123G should be seen as 12 and 3, then there's no way that Excel could determine that.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    04-07-2024
    Location
    United Kingdom
    MS-Off Ver
    365 v2401
    Posts
    3

    Re: Summing Numbers in Cells Including Consecutive Numbers

    This works fantastically! I can also confirm the following work for this:
    =SUM(VALUE(TEXTSPLIT(TEXTJOIN(,, IFERROR(VALUE(MID(A1, SEQUENCE(1, LEN(A1)), 1)), "|")),, "|", 1))) - Building on my own attempt
    =SUM(--TEXTSPLIT(A1, TEXTSPLIT(A1, SEQUENCE(10) - 1, , 1), , 1)) - Similar approach to your own

    Surprising there are so many ways!

  5. #5
    Registered User
    Join Date
    04-07-2024
    Location
    United Kingdom
    MS-Off Ver
    365 v2401
    Posts
    3

    Re: Summing Numbers in Cells Including Consecutive Numbers

    See fluff13's response he has managed to find a solution to this! Note my example was slightly different to yours. "M12G3" not "M123G"

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,760

    Re: Summing Numbers in Cells Including Consecutive Numbers

    Glad to help & thanks for the feedback.

+ 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] Filling in consecutive cells up to different max numbers.
    By GreggR57 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2021, 12:51 PM
  2. Locate Cells with 5 consecutive numbers or more
    By Demoniacs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-01-2020, 07:18 PM
  3. [SOLVED] Compare consecutive numbers between 2 cells
    By Najwa_X in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-17-2020, 09:40 AM
  4. Replies: 3
    Last Post: 09-15-2017, 05:30 AM
  5. [SOLVED] Trying to extract text cells at the first instance of four consecutive numbers
    By portokie in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-15-2016, 06:32 PM
  6. How to fill a column of cells with consecutive numbers ?
    By M-Ray in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2013, 09:59 AM
  7. Replies: 3
    Last Post: 06-27-2013, 08:03 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