+ Reply to Thread
Results 1 to 5 of 5

Using a string function within a range in SUMIF -- possible?

  1. #1
    Registered User
    Join Date
    02-17-2011
    Location
    Waco, Tx
    MS-Off Ver
    Excel 2010
    Posts
    19

    Using a string function within a range in SUMIF -- possible?

    Is it possible to use SumIf with a string function in the range? Example is if I have these columns and I also have it attached in Excel:

    001 - Total Cat1 12
    001 - Total Cat2 43
    001 - Total Cat3 44
    002 - Total Cat1 43
    002 - Total Cat2 66
    002 - Total Cat3 89
    003 - Total Cat1 23
    003 - Total Cat2 11
    003 - Total Cat3 23

    Total Cat1 78
    Total Cat2 120
    Total Cat3 156

    I'd need to do a Right string function on Column A to only compare the Right 10 characters but I'm not able to find a way to do this. Can this be done in the SUMIF Criteria Range without having to create a new column just to contain this info?

    Thanks --
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    02-17-2011
    Location
    Waco, Tx
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Using a string function within a range in SUMIF -- possible?

    Actually I just found that I can use wildcards in the criteria parameter so this works:
    =SUMIF(A2:A10,"*Total Cat1",B2:B10)

    So consider this solved.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using a string function within a range in SUMIF -- possible?

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Using a string function within a range in SUMIF -- possible?

    =SUMPRODUCT(--ISNUMBER(FIND(A12,$A$2:$A$10)),$B$2:$B$10) on your sample yeilds the same result as you have
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Using a string function within a range in SUMIF -- possible?

    Helpful hint, using references so you can drag it.

    =SUMIF($A$2:$A$10,"*"&A12,$B$2:$B$10)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ 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