Hi,
I have a file with image file names in column A.
The text strings have a SIMILAR format in that they start with the ID;
Then have a sales AGENT - i.e. AMAZON
Then they have EITHER a brand withing the AGENT - in this case TICKETS or they have CHANNEL - i.e. email, social (FB for Facebook, TW for Twitter, etc), website, ETC
Then they have a 6 DIGIT DATE
Then, some (not all) have a letter after the 6 digit date - this is indicative or more than one occurrence of this activity on that date (i.e. they tweeted more than once on 12 June)
The inconsistency of how many elements there are in the string is something I cannot change BUT the following are consistent.
- after ID there is always an underscore _
- there is one further underscore before a 6 digit date
- the elements between ID and DATE are always split by an - character
- the indicator of more than one occurrence is ALWAYS a letter, A being the first, B being the second, etc
WHAT I NEED TO DO;
1. extract the 6 digits that occur as a 6 digit block. I googled and found many examples on this and other sites - various formula which populate several rows of column D of the attached. D2 and D3 looks closest but fall over when there is more than one zero in the 6 digit number. Can someone help with a version that ALWAYS give the 6 digit extract and also help with how this can be adapted should I ever need to expand to 7 or 8 digits, or fewer.
2. extract the single LETTER after a 6 DIGIT DATE only where it exists, as in most cases the 6 digit date is following by a . and a file extension
3. a formula to extract the text between first and second -, between second and third -, etc, in a way I can edit it to look at different positions in the string
OR even better a way (possibly VBA?) to split all elements into columns, with date always in the most right hand column at one touch.
That may be too tricky, so I can build something with columns to do each part if I can figure out extracting the above elements from the string.
I can then lookup on the words extracted to populate CHANNEL, BRAND, MACRO_CHANNEL, etc.
Have highlighted on the attached, in YELLOW where I have manually typed in what I'd expect to extract.
Even if someone can nail 1 and 2 for me, I can probably - even manually (sigh) manage the rest. Or run a file rename software to standardise the middle text blocks between -
Hope someone can assist please?
Ian
Bookmarks