+ Reply to Thread
Results 1 to 8 of 8

Find specific text at end of cell (i.e. Ends in "-2")

Hybrid View

  1. #1
    Registered User
    Join Date
    07-30-2012
    Location
    Arlington, TX
    MS-Off Ver
    Excel 2010
    Posts
    47

    Find specific text at end of cell (i.e. Ends in "-2")

    This has to be easy, but I can't figure it out. I am trying to determine if the cell ends in "-2". If it does, "Shared" if it does not, "".

    I found this in another post and thought it might work, but didn't: =IF(ISERROR(FIND("-2",D1,1)),"SHARED","")
    I also found this, and it didn't work either because of the "-" in front of the 2. =ISNUMBER(FIND("-2",D:D,LEN(D:D)))

    Excel has a built in function to filter by cells that end with a certain criteria, so it has to be possible.

    My end goal is to throw this into an ifs() formula:
    if the cell D1 ends in "-2", then countifs(A:A,B1)

    I can get the bandaid if someone can help with the "-2" part.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Find specific text at end of cell (i.e. Ends in "-2")

    Hi

    =IF(RIGHT(D1,2)="-2",COUNTIFS(A:A,B1),"")
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-30-2012
    Location
    Arlington, TX
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Find specific text at end of cell (i.e. Ends in "-2")

    Thanks for the reply- just so I understand why, can you explain the =if(right(D1,2)...?

    I don't understand the logic for that part. Why the #2?

  4. #4
    Registered User
    Join Date
    07-30-2012
    Location
    Arlington, TX
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Find specific text at end of cell (i.e. Ends in "-2")

    I have having issues with this when I try to SUM all the cells that meet that condition.

    =IF(LEFT(B2:B71,1)="H",SUM(C2:C71),"ERROR")

    See the attached spreadsheet. I also have 3 goals I am trying to do that are explained on the spreadsheet. Can you help me with those formulas?

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

    Re: Find specific text at end of cell (i.e. Ends in "-2")

    RIGHT(D1,2) means the last (or right-most) 2 characters of the the string in D1
    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.

  6. #6
    Registered User
    Join Date
    07-30-2012
    Location
    Arlington, TX
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Find specific text at end of cell (i.e. Ends in "-2")

    Here is the attachment
    Attached Files Attached Files

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

    Re: Find specific text at end of cell (i.e. Ends in "-2")

    You can use SUMIF and SUMIFS(for multiple criteria) and wildcards

    e.g.

    =SUMIF(B2:B71,"H*",C2:C71)

    =SUM(SUMIFS(C2:C71,A2:A71,"Arlington Hall",B2:B71,{"Dbl*","Double*"}))

    =SUMIFS(C2:C71,A2:A71,"The Lofts",B2:B71,"*-2BR-*")

  8. #8
    Registered User
    Join Date
    07-30-2012
    Location
    Arlington, TX
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Find specific text at end of cell (i.e. Ends in "-2")

    Perfect- Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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