+ Reply to Thread
Results 1 to 6 of 6

formula sumproduct with criteria any letter at "end" of a number

  1. #1
    Forum Contributor
    Join Date
    04-18-2011
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    105

    formula sumproduct with criteria any letter at "end" of a number

    I am using formula =SUMPRODUCT(ISNUMBER($L$11:$L$100)*($K$11:$K$100="Yes")) whereby i distinguish if column L is number or text.

    Now due to a restructure (group 1) I have got number and a letter at the "end" (123A) and i want to be able to pick this up on the formula including the numbers.

    Group 1 - numbers (1111) , numeric character (1123a)

    Group 2 - alpha numeric (a123)
    Last edited by nd4spd; 05-21-2013 at 06:52 AM.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: formula sumproduct with criteria any letter at "end" of a number

    hi nd4spd, try:
    =SUMPRODUCT(ISNUMBER(LEFT($L$11:$L$100)+0)*($K$11:$K$100="Yes"))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Contributor
    Join Date
    04-18-2011
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    105

    Re: formula sumproduct with criteria any letter at "end" of a number

    Thanks benishiryo . just to complete the scenario what do i change for Group 2 with letter at start =SUMPRODUCT((ISTEXT($L$11:$L$100)*($K$11:$K$100="Yes")))

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,717

    Re: formula sumproduct with criteria any letter at "end" of a number

    Try

    =SUMPRODUCT(ISERR((0&LEFT($L$11:$L$100))+0)*($K$11:$K$100="Yes"))
    Audere est facere

  5. #5
    Forum Contributor
    Join Date
    04-18-2011
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    105

    Re: formula sumproduct with criteria any letter at "end" of a number

    Thanks daddylonglegs it works !! Solved. but could one explain
    1.=SUMPRODUCT(ISNUMBER(LEFT($L$11:$L$100)+0)*($K$11:$K$100="Yes"))
    why zero at the end
    why "LEFT" when it is RIGHT 1 character to check (123a) ISNUMBER(LEFT($L$11:$L$100)+0
    and where this formula takes into account all numerical ?

    2. 0& in this example ISERR((0&LEFT($L$11:$L$100))+0

    thanks
    Last edited by nd4spd; 05-21-2013 at 06:59 AM.

  6. #6
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: formula sumproduct with criteria any letter at "end" of a number

    the common factor between these 2 are that both starts with a number:
    1111
    1123a
    so i used LEFT to find out if the 1st character is a number. but if you use LEFT, RIGHT or MID, it will turn numbers into a text. assuming A1 contains 1111, you can try
    =LEFT(A1,1)=1
    or:
    =LEFT(A1)=1
    it would be FALSE
    but if you add a +0, it turns it to a number back again, provided it really is a number:
    =LEFT(A1,1)+0=1

    DDL's method to handle the other scenario is to use ISERR, which does the opposite of what happens with ISNUMBER scenario. when the 1st left character +0 is an alphabet, it will return a VALUE error (which will turn TRUE. and that's what you need. to count those that does not contain a number in the first character). he added a 0& in front to deal with blanks i suppose. if you take the 1st character of a blank, it will return nothing. nothing + 0 will give you a VALUE error. and you don't want to add that to your 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