+ Reply to Thread
Results 1 to 6 of 6

Sumproduct conditioning on the first characters

  1. #1
    Registered User
    Join Date
    10-22-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    43

    Sumproduct conditioning on the first characters

    Hi, I have here a small sample of my large data set. I want a formula in cell E2 to return the number of pages for the chapter given in cell E1. The problem is that some chapters begins with the same numbering and I only want number of pages for exact given chapter in cell E1. So far I have set up a sumproduct for efficiency, and match because it is a string (though not working). Also I get the results from all chapters beginning with number e.g. seach for 1.1 and I get 1.1, 1.1.0, 1.1.1 and so on. How can I set a formula that only gives me number of pages for chapter 1.1 and no other suffixes?
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Sumproduct conditioning on the first characters

    Try this:

    =SUMIF($A$2:$A$7,$E$1,$B$2:$B$7)

    This gave me an answer of 100 when I put 1.1 in E1
    Excel is a constant learning process and it's great to help each other. If any of us have helped you today, a click on the "reputation" star on the left is appreciated.

  3. #3
    Registered User
    Join Date
    10-22-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Sumproduct conditioning on the first characters

    Thanks that works great. How can the formula be changed if I want pages for all chapter starting with 1.1?

  4. #4
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Sumproduct conditioning on the first characters

    An array formula would do the trick in E2:

    {=SUM(IF(LEFT($A$2:$A$7,3)=$E$1,$B$2:$B$7))}

    Don't forget to press Ctrl+Shift+Enter when you put this in to make sure it's an array formula.

    By the way, you would need to enter E1 as text for this to work
    Last edited by shirleyxls; 06-16-2016 at 05:49 AM. Reason: E1 as text

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

    Re: Sumproduct conditioning on the first characters

    Maybe like this ...

    =SUMIF($A$2:$A$7,$E$1&"*",$B$2:$B$7)
    Last edited by Phuocam; 06-16-2016 at 07:54 AM.

  6. #6
    Registered User
    Join Date
    10-22-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Sumproduct conditioning on the first characters

    Hi the answer I get is not 100 as I want. So only want the number of pages for just chapter 1.1

+ 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. [SOLVED] SUMPRODUCT & wildcard characters
    By baxcat in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-24-2011, 03:57 AM
  2. SumProduct, IF, First 3 Characters
    By koklok123 in forum Excel General
    Replies: 8
    Last Post: 03-02-2010, 11:27 AM
  3. Using Wildcard characters in sumproduct
    By Biff in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 03:05 PM
  4. [SOLVED] Using Wildcard characters in sumproduct
    By Charles in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  5. [SOLVED] Using Wildcard characters in sumproduct
    By Charles in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  6. [SOLVED] Using Wildcard characters in sumproduct
    By Biff in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 04:05 AM
  7. Using Wildcard characters in sumproduct
    By Charles in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  8. Using Wildcard characters in sumproduct
    By Charles in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-22-2005, 02:05 AM

Tags for this Thread

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