+ Reply to Thread
Results 1 to 5 of 5

Sum cells that have numbers and letters in them!

  1. #1
    Registered User
    Join Date
    08-23-2006
    Location
    Darlington, England
    MS-Off Ver
    Microsoft 365
    Posts
    33

    Sum cells that have numbers and letters in them!

    Hi
    I am struggling to find a formula for the following can anyone help!
    As an example I have a row with the following numbers and letters in each cell
    I would like to sum the whole row but only add the numbers in the cells that have SC in them. The three cells that have SC in them would total 7.
    Can anyone help with a formula thanks!

    2SC, 8, 8, 1SC, 4SC,

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

    Re: Sum cells that have numbers and letters in them!

    If we assume values in A1:E1 then

    F1: =SUMPRODUCT(--(RIGHT(A1:E1,2)="SC"),--SUBSTITUTE(A1:E1,"SC",""))

  3. #3
    Registered User
    Join Date
    08-23-2006
    Location
    Darlington, England
    MS-Off Ver
    Microsoft 365
    Posts
    33

    Re: Sum cells that have numbers and letters in them!

    Thank you for your time

    That formula works fine but I have a few problems with it.
    If I have a blank cell or a cell with just SC in it the formula does not work can you tweek it so it does

    much appreciated!

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

    Re: Sum cells that have numbers and letters in them!

    Sure, just try adding a 0 to each value in the calculation, eg:

    Please Login or Register  to view this content.
    If you may have other text string values that need ignoring then it might be worth reverting to an Array - though pending strings it's unlikely to be 100% watertight.

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 01-11-2010 at 12:26 PM.

  5. #5
    Registered User
    Join Date
    08-23-2006
    Location
    Darlington, England
    MS-Off Ver
    Microsoft 365
    Posts
    33

    Re: Sum cells that have numbers and letters in them!

    My problem is solved

    I ended up using the array as I had other values in there to

    Thats brilliant thanks

+ 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