+ Reply to Thread
Results 1 to 8 of 8

Formula to add numbers and exclude text values

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Formula to add numbers and exclude text values

    Hi,

    Hope someone can help. I need a formula that calculates the values of 5 seperate cells located in different places throughout my sheet. The value will either be numerical or display a text value (normally "RD"). If it displays text I do not want that value counted. So it literally just totals the number values.

    Thanks
    Last edited by jpruffle; 04-01-2009 at 05:26 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,038

    Re: Formula to add numbers and exclude text values

    =SUM(cell1;cell2;...) will sum numbered cells only, text won't effect it.

    Edit: also =COUNT(cell1;cell2;cell3...) IF you want all to be counted you can use =COUNTA(cell1;cell2;cell3...)
    Never use Merged Cells in Excel

  3. #3
    Forum Contributor mubashir aziz's Avatar
    Join Date
    03-18-2009
    Location
    Lahore, Pakistan
    MS-Off Ver
    MS Office 2013
    Posts
    533

    Re: Formula to add numbers and exclude text values

    Simply Use

    =Count(A5,C6,D8,F7) it will count only numeric values

    = Counta(A5,C6,D8,F7) will count all value

  4. #4
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Re: Formula to add numbers and exclude text values

    Thank you for the quick reply. Neither seem to work.

    Effectively I want to add:

    =SUM(C42+C34+C26+C18+C10)
    Any of those value could contain text. When they do this formula and count return #VALUE!. I need the calculation to exclude text and just add numbers.

    Any ideas?

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,038

    Re: Formula to add numbers and exclude text values

    not +... put ; (or ,)

    =SUM(C10;C18;C26...)

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Formula to add numbers and exclude text values

    As zbor indicates, when you use C4+C34, etc.. you will get an error if cell(s) contain something else than numbers

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to add numbers and exclude text values

    So either

    =SUM(C10,C18 etc...)

    or if you have a large dataset, say you want to sum 50 values and don't want to type them / reference them individually then given they are seemingly equal spaced you could also use a Sumproduct approach, eg:

    =SUMPRODUCT(--(MOD(ROW(C10:C402)-10,8)=0),C10:C402)

  8. #8
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Re: Formula to add numbers and exclude text values

    Thank you all for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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