+ Reply to Thread
Results 1 to 8 of 8

Help with Sum formula

  1. #1
    Valued Forum Contributor sans's Avatar
    Join Date
    10-19-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    550

    Help with Sum formula

    Hello to everyone,

    I hope someone can help me out. I have a row with the following numbers:

    2-3-5-7-8-9-15-17-18-29-35

    My total rows are 4000 and at each row the numbers are different but are always add up to 11 in total. For instance,

    2-3-5-7-8-9-15-17-18-29-35
    1-4-6-9-13-17-19-25-26-27-38
    etc

    What I'd like to do is to automatically get how many from the following numbers are in each row: 2-6-17-29-35. These numbers never change

    For instance,

    In 2-3-5-7-8-9-15-17-18-29-35 there are 4 numbers from 2-6-17-29-35
    In 1-4-6-9-13-17-19-25-26-27-38 - 2 numbers
    etc

    Is this possible? If anyone can help me out it would be amazing as I will save days in trying to do it manually.

    Thanks
    Sans
    Last edited by sans; 10-20-2011 at 06:24 AM.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Help with Sum formula

    If you're looking at one row at a time (say the value is in A1) then formula you want is =SUM(--(NOT(ISERROR(FIND("-" & {2,6,17,29,35} & "-","-" & A1 & "-")))))

  3. #3
    Valued Forum Contributor sans's Avatar
    Join Date
    10-19-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    550

    Re: Help with Sum formula

    Thank you so much for your help! You saved me so much time! What if the 11 numbers, are in different cells? For instance,

    B3-C3-D3-E3-F3- G3- H3 - I3 - J3 -K3 - L3
    2 - 3 -5 - 7 - 8 - 9 - 15 - 17 - 18 - 29 - 35

    Again thank you,
    Sans

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Help with Sum formula

    Assuming they're in columns A:K then =SUM(COUNTIF(A1:K1,{2,6,17,29,35}))

  5. #5
    Valued Forum Contributor sans's Avatar
    Join Date
    10-19-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    550

    Re: Help with Sum formula

    Amazing! Thank you so much! Is there a book that includes all these formulas or do you write them on a case by case basis?

    Sans

  6. #6
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Help with Sum formula

    It's a case-by-case basis for me, although I believe that some people who've been here longer than me do keep a list of answers to common questions.

  7. #7
    Valued Forum Contributor sans's Avatar
    Join Date
    10-19-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    550

    Re: Help with Sum formula

    Again, thank you for your help.
    Sans

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Help with Sum formula

    Andrew is right, I know I have several reference "lists" of common Qs & As. Posing qualified questions in a forum (or just searching the forum or the keywords) is much quicker than thumbing through a book.

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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