Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Excel Formula - certain part of string

Posted on 2016-10-12
2
Medium Priority
?
106 Views
Last Modified: 2016-10-12
I am trying to use a formula, that looks at a string and search for a certain word, but I want to only search after the last "-"

for example

This would return a true statement - test-test123-test-test123  as test123 is the last part of text

This would return a false statement - test-test-test123-test456 as test456 is the last part of the text

Any suggestions on how i can accomplish this ?
0
Comment
Question by:dkilby
2 Comments
 
LVL 27

Accepted Solution

by:
Shaun Kline earned 2000 total points
ID: 41840717
Something like this:

=NOT(ISERROR(FIND(B2, A2, FIND("~", SUBSTITUTE(A2, "-", "~", LEN(A2)-LEN(SUBSTITUTE(A2, "-", "")))))))

Open in new window


where your search term is in B2 and your string to be searched is in A2.
0
 

Author Closing Comment

by:dkilby
ID: 41840810
thank you
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question