Solved

Reverse Find in Excel

Posted on 2015-02-24
6
117 Views
Last Modified: 2015-02-24
I have a text string, let's say it is "test this, string".  I can find the position of the comma (position 10) and need to know at what position the space appears BEFORE the comma (this would be position 5).  Can I use a reverse string or -FIND to start at the comma (position 10) and pull back position 5?  I need to do without VBA.
0
Comment
Question by:marku24
6 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 40628973
How many different variations of text are there?  May not be possible if there isn't standardized text without using VBA.
0
 

Author Comment

by:marku24
ID: 40628988
No standardized text.  All different length and characters but typically only 1 comma per text string
0
 
LVL 15

Expert Comment

by:David L. Hansen
ID: 40629010
You can avoid using vba by using a regex formula; however, if you are not familiar with regular expressions, you may find learning the formula harder than getting into vba.

From the "Developer" tab select the "Visual Basic" icon and then In the VBA window choose "Tools" from the menu. Then choose "References" and add "Microsoft VBScript Regular Expressions 5.5". Now you can start using regular expressions in your cells.

Note, regular expressions are extremely fast and can be used in almost any programming language. So it is worth learning.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:marku24
ID: 40629033
thank you on the regex suggestion.  Little complcated for me.  I will look to do with VBA.  
Thanks
0
 
LVL 12

Accepted Solution

by:
Jeff Darling earned 500 total points
ID: 40629122
Here is one way to do it.  although it takes a few columns to hold intermediate data....
EE2015022401.xlsx
0
 

Author Closing Comment

by:marku24
ID: 40629160
great job.  Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

685 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