+ Reply to Thread
Results 1 to 6 of 6

How to SUM if the cells contain numbers & text

  1. #1
    Registered User
    Join Date
    03-11-2017
    Location
    London
    MS-Off Ver
    12.3.6
    Posts
    2

    How to SUM if the cells contain numbers & text

    Hi everyone,

    Hopefully this is a straight forward one?!
    I've been trawling through lots of forums for a simple answer to this but can't seem to find one.

    I want to be able to do a SUM total of a list of numbers, however my list contains text in each cell and looks like this:

    2 (Bob)
    5 (Dave)
    18 (Sharon)
    6 (Trudy)

    Is there a simple way to do a SUM formula at the bottom of this which just gives me the total SUM of the numbers.

    I've seen some people saying that doing =SUM(A1:A4) will leave out text but this is only if one cell has a number and one cell has text, not if the cells have both a number and text in the same cell.
    When I try to use this formula on my current list the number reads "0".

    Any & all help welcome!

  2. #2
    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: How to SUM if the cells contain numbers & text

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

    v A B C
    1 2 (Bob) 31
    2 5 (Dave)
    3 18 (Sharon)
    4 6 (Trudy)
    5
    Last edited by AlKey; 03-11-2017 at 08:31 AM.
    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

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: How to SUM if the cells contain numbers & text

    Hi earp13 and welcome to the forum,

    Why you would ever want to do this is unknown. You should really pull the numbers out to a new column and add zero to them (so they are numbers) and then add them. BUT here is an answer for you. It is an array formula so needs to be entered with the Ctrl and Shift keys down before you press the enter key. See CSE or Array formulas in excel.
    Please Login or Register  to view this content.
    Array formula to add left numbers.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    03-11-2017
    Location
    London
    MS-Off Ver
    12.3.6
    Posts
    2

    Re: How to SUM if the cells contain numbers & text

    It works!
    Thanks for this.
    Just so I'm able to learn something about this process what is the significance of the last part of the formula (" ",A2)))

    Also, I've noticed that if you have some cells in the list which are blank it gives a #Value! is there a way to stop it from doing this?

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,915

    Re: How to SUM if the cells contain numbers & text

    Try this ...

    =SUM(IFERROR(--LEFT(A1:A4,FIND(" ",A1:A4&" ")-1),""))

    Enter with Ctrl+Shift+Enter.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to SUM if the cells contain numbers & text

    Try this...

    Data Range
    A
    B
    C
    1
    Name
    Total
    2
    2 (Bob)
    41
    3
    5 (Dave)
    4
    18 (Sharon)
    5
    6 (Trudy)
    6
    7
    10 (Biff)


    This array formula** entered in C2:

    =SUM(IF(ISNUMBER(--LEFT(A1:A10)),--LEFT(A1:A10,FIND(" ",A1:A10)-1)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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: 07-21-2014, 10:33 AM
  2. how to sum numbers formated as a text ignoring text in cells
    By luis6777 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-30-2014, 01:45 PM
  3. [SOLVED] Delete text, split numbers to two cells and store as numbers
    By Steve_123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2014, 09:51 AM
  4. Replies: 3
    Last Post: 01-08-2014, 10:50 PM
  5. [SOLVED] Vlookup formula - return only numbers for cells containing text and numbers
    By Andrew E Smith in forum Excel General
    Replies: 11
    Last Post: 07-03-2012, 06:07 AM
  6. Replies: 6
    Last Post: 02-23-2012, 09:56 AM
  7. Replies: 10
    Last Post: 03-07-2009, 05:40 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