+ Reply to Thread
Results 1 to 6 of 6

Use sumifs only when first character in cell matches criteria

  1. #1
    Registered User
    Join Date
    12-02-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    21

    Use sumifs only when first character in cell matches criteria

    I am trying to sum information if the my data meets three criteria: 1) customer is 98012, 2) Currency is USD, 3) Invoice starts with a specific letter. The last part is where I am having my problem. I am using the sum if formula, but I can't seem to isolate the invoice number. I tried: IF(+LEFT(E:E,1)="T",+SUMIFS(C:C,A:A,"98012",E:E,">T",B:B,"USD"),"") and that worked, but only because T invoices are the last alpha character. When I change it to O: IF(+LEFT(E:E,1)="O",+SUMIFS(C:C,A:A,"98012",E:E,">O",B:B,"USD"),"") it either doesn't work at all or it adds the O and the T invoices and that's not what I want. Plus, there must be something better than this if statement. So I want to be able to determine what is the total for customer 98012 if the currency code is USD and the Invoice starts with a T.

    Can someone help?

    Customer Currency Amount Date Invoice
    98012 USD 72662.5 8-Mar-12 T114555
    98012 USD 32539.52 30-Mar-12 O229580
    98012 USD 29635.77 15-Mar-12 O214262
    98012 USD 15018.24 30-Mar-12 T126466
    98012 USD 7509.12 23-Mar-12 T122940
    98012 EUR 6006 13-Mar-12 T116862
    98012 USD 5006.08 27-Mar-12 T124332
    98012 USD 2503.04 16-Mar-12 T119070
    98012 USD 15518.2 10-Apr-12 T131756
    98012 EUR 9702 31-May-12 O283985
    94034 USD 8869.7 28-Mar-12 O214265
    94034 EUR 162.83 28-Mar-12 B353149
    94034 CHF 93.94 28-Mar-12 B353114
    94034 USD 37411.49 23-May-12 T155800
    94034 USD 32886.04 30-May-12 T158846
    Attached Files Attached Files

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

    Re: Use sumifs only when first character in cell matches criteria

    Try:

    =SUMIF($E$2:$E$16,LEFT(G3)&"*",$C$2:$C$16)

    copied down
    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.

  3. #3
    Registered User
    Join Date
    06-19-2012
    Location
    N/A
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: Use sumifs only when first character in cell matches criteria

    In cell G3, enter:

    Please Login or Register  to view this content.
    and drag it down.

    Hope this helps
    If I have helped, please click the star below.

  4. #4
    Forum Guru Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,067

    Re: Use sumifs only when first character in cell matches criteria

    Rob's solution does not meet the other two required criteria

    Try this...

    =IF(+LEFT(E:E,1)="T",+SUMIFS(C:C,A:A,"98012",E:E,"T*",B:B,"USD"),"") for the 'T' invoices &
    =IF(+LEFT(E:E,1)="T",+SUMIFS(C:C,A:A,"98012",E:E,"O*",B:B,"USD"),"") for the 'O' invoices
    Life's a spreadsheet, Excel!
    Say thanks, Click *

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

    Re: Use sumifs only when first character in cell matches criteria

    Since it looks like you have 2003, SUMIFS won't work...try:

    =SUMPRODUCT(--(LEFT($E$2:$E$16)=LEFT(G3)),--($B$2:$B$16="USD"),$C$2:$C$16)

  6. #6
    Registered User
    Join Date
    06-19-2012
    Location
    N/A
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: Use sumifs only when first character in cell matches criteria

    Quote Originally Posted by NBVC View Post
    Since it looks like you have 2003, SUMIFS won't work...
    Oops. My mistake. Apologies to the OP.

+ 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