+ Reply to Thread
Results 1 to 23 of 23

Summing Cells that have more than one value?

  1. #1
    Registered User
    Join Date
    10-25-2018
    Location
    Manchester, England
    MS-Off Ver
    MS 365 Enterprise
    Posts
    73

    Summing Cells that have more than one value?

    Is there a formula that will SUM all values of a single cell.

    For example:

    If I have a cell that contains more than one value, say 100 and 200 in same cell. Is there a formula to SUM these 2 values in another cell?

    Thanks in advance

  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,026

    Re: Summing Cells that have more than one value?

    You did not tell us what the separator is.

    This formula:

    =SUMPRODUCT(--MID(SUBSTITUTE(A1,CHAR(10),REPT(" ",99)),99*(ROW(INDIRECT("1:"&LEN(A1)-LEN(SUBSTITUTE(A1,CHAR(10),""))+1))-1)+1,99))

    is set up for CHAR(10) - new line - separators.
    Attached Files Attached Files
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Banned User!
    Join Date
    01-26-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    32

    Re: Summing Cells that have more than one value?

    It would be better to split the cells so that one value is contained in each cell.

  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,026

    Re: Summing Cells that have more than one value?

    Or if it is a space....

    =SUMPRODUCT(--MID(SUBSTITUTE(A1," ",REPT(" ",99)),99*(ROW(INDIRECT("1:"&LEN(A1)-LEN(SUBSTITUTE(A1," ",""))+1))-1)+1,99))

  5. #5
    Registered User
    Join Date
    10-25-2018
    Location
    Manchester, England
    MS-Off Ver
    MS 365 Enterprise
    Posts
    73

    Re: Summing Cells that have more than one value?

    I am using a PDF converted to Excel file as a feed sheet so I can just copy and paste the sheet in once converted, so can't really split the cell unfortunately.

  6. #6
    Banned User!
    Join Date
    01-26-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    32

    Re: Summing Cells that have more than one value?

    Text to columns deliminated can do that

  7. #7
    Registered User
    Join Date
    10-25-2018
    Location
    Manchester, England
    MS-Off Ver
    MS 365 Enterprise
    Posts
    73

    Re: Summing Cells that have more than one value?

    "1,217
    UK & Ireland
    663
    Web UK & IE"

    The cell I want to sum contains the above.

  8. #8
    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,026

    Re: Summing Cells that have more than one value?

    Now that is a totally different question, isn't it. In Post 1 you never mentioned that there was text in the cells as well.

    You will need VBA for that.
    Last edited by Glenn Kennedy; 01-29-2019 at 07:14 AM.

  9. #9
    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,026

    Re: Summing Cells that have more than one value?

    Try this:

    Please Login or Register  to view this content.
    How to install your new code
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Press Alt+F11 to open the Visual Basic Editor
    Choose Insert > Module
    Edit > Paste the macro into the module that appeared
    Close the VBEditor
    Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)


    =SUMnUMBERS(A1)
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    10-25-2018
    Location
    Manchester, England
    MS-Off Ver
    MS 365 Enterprise
    Posts
    73

    Re: Summing Cells that have more than one value?

    I basically want to be able to paste my PDF to excel sheet into a back sheet so the data pulls through to the front sheet automatically but SUMS the multiple values from one cell from the back sheet into 1 cell on the front sheet.

    Does this make sense?

  11. #11
    Banned User!
    Join Date
    01-26-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    32

    Re: Summing Cells that have more than one value?

    Glenn has the reins I opt out.

    Good luck

  12. #12
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Summing Cells that have more than one value?

    Text at A1

    Please try at B1 and press Ctrl+Shift+Enter

    =SUM(IFERROR(--MID(SUBSTITUTE(SUBSTITUTE(A1,CHAR(10)," ")," ",REPT(" ",100)),ROW(INDIRECT("1:20"))*100-99,100),))

  13. #13
    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,026

    Re: Summing Cells that have more than one value?

    Very nice, Bo. I can't add rep for you 'cos of forum restrictions...

  14. #14
    Registered User
    Join Date
    10-25-2018
    Location
    Manchester, England
    MS-Off Ver
    MS 365 Enterprise
    Posts
    73

    Re: Summing Cells that have more than one value?

    I have attached an example workbook.

    I need the formula to SUM the 2 numbers in cell A29 on Front Sheet and display the SUM in cell D3 on the back shet.
    Attached Files Attached Files

  15. #15
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Summing Cells that have more than one value?

    Thanks, Glenn

    Congratulations on your promotion.

  16. #16
    Registered User
    Join Date
    10-25-2018
    Location
    Manchester, England
    MS-Off Ver
    MS 365 Enterprise
    Posts
    73

    Re: Summing Cells that have more than one value?

    Sorry SUM of numbers in A29 back sheet need to pull through a a SUM on D3 front sheet.

  17. #17
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Summing Cells that have more than one value?

    Please try at D3 and press Ctrl+Shift+Enter

    =SUM(IFERROR(--MID(SUBSTITUTE(SUBSTITUTE('Back (Feed) Sheet'!A29,CHAR(10)," ")," ",REPT(" ",100)),ROW(INDIRECT("1:20"))*100-99,100),))


    or this press Ctrl+Shift+Enter and drag down

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    10-25-2018
    Location
    Manchester, England
    MS-Off Ver
    MS 365 Enterprise
    Posts
    73

    Re: Summing Cells that have more than one value?

    Quote Originally Posted by Bo_Ry View Post
    Please try at D3 and press Ctrl+Shift+Enter

    =SUM(IFERROR(--MID(SUBSTITUTE(SUBSTITUTE('Back (Feed) Sheet'!A29,CHAR(10)," ")," ",REPT(" ",100)),ROW(INDIRECT("1:20"))*100-99,100),))


    or this press Ctrl+Shift+Enter and drag down

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Hi Bo,

    When I try Ctrl,Shift,Enter it just opens the Save file window?

  19. #19
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Summing Cells that have more than one value?

    Please download sheet from post#17 and see.

  20. #20
    Registered User
    Join Date
    10-25-2018
    Location
    Manchester, England
    MS-Off Ver
    MS 365 Enterprise
    Posts
    73

    Re: Summing Cells that have more than one value?

    Thank Bo, you are a star

  21. #21
    Registered User
    Join Date
    10-25-2018
    Location
    Manchester, England
    MS-Off Ver
    MS 365 Enterprise
    Posts
    73

    Re: Summing Cells that have more than one value?

    Quote Originally Posted by Bo_Ry View Post
    Please download sheet from post#17 and see.
    Hi Bo

    Can I just ask, if I amend the report I am using so the cell only contains numbers and no text - Will the formula you provided still work?

    Regards
    Tom

  22. #22
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Summing Cells that have more than one value?

    It should work if the delimiters of each number are space or char(10) (Alt+Enter).

  23. #23
    Registered User
    Join Date
    10-25-2018
    Location
    Manchester, England
    MS-Off Ver
    MS 365 Enterprise
    Posts
    73

    Re: Summing Cells that have more than one value?

    Quote Originally Posted by Glenn Kennedy View Post
    Try this:

    Please Login or Register  to view this content.
    How to install your new code
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Press Alt+F11 to open the Visual Basic Editor
    Choose Insert > Module
    Edit > Paste the macro into the module that appeared
    Close the VBEditor
    Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)


    =SUMnUMBERS(A1)
    Hi

    I tried this method and it came back with 789, one of the values is 788 and the other is 1269 - Any ideas?

+ 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. Summing a variable number of cells and parts of cells
    By nickyboy99 in forum Excel General
    Replies: 2
    Last Post: 03-18-2014, 12:54 PM
  2. summing up n consecutive cells in a column for 1000 cells
    By Zundah in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2013, 10:54 AM
  3. [SOLVED] Summing cells and Dividing it by the number of not blank cells
    By jpb4262000 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-21-2013, 11:34 PM
  4. Summing cells
    By Statz in forum Excel General
    Replies: 6
    Last Post: 04-13-2010, 11:43 PM
  5. help with summing cells
    By mrwolfy in forum Excel General
    Replies: 1
    Last Post: 04-02-2010, 12:28 AM
  6. Summing up cells that have an #n/a
    By drillguy in forum Excel General
    Replies: 9
    Last Post: 10-26-2008, 07:47 PM
  7. Summing up cells based on values of other cells
    By ramakavin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-26-2008, 03:19 PM
  8. Summing some cells
    By Jim in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-18-2005, 10:06 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