How can i extract a variable number of characters from the rhs and keep the result as a string?

JeffGrant

Well-known Member
Joined
Apr 7, 2021
Messages
519
Office Version
  1. 365
Platform
  1. Windows
Hi All, I have csv files that look like this.

GetAllScratchingsText.csv
A
1Auto Scratchings File
2Scr,210710awapuni01,H,7,
3Scr,210710awapuni02,H,
4Scr,210710awapuni03,H,
5Scr,210710awapuni04,H,
6Scr,210710awapuni05,H,5,
7Scr,210710awapuni06,H,1,
8Scr,210710awapuni07,H,15,16,
9Scr,210710awapuni08,H,
10Scr,210710awapuni09,H,
11Scr,210710awapuni10,H,
12Scr,210710awapuni11,H,
13Scr,210710awapuni12,H,
14Scr,210711ballarat01,H,6,7,9,
15Scr,210711ballarat02,H,2,
16Scr,210711ballarat03,H,
17Scr,210711ballarat04,H,7,
18Scr,210711ballarat05,H,
19Scr,210711ballarat06,H,
20Scr,210711ballarat07,H,
21Scr,210711ballarat08,H,
22Scr,210711ballarat09,H,
23Scr,210711ballarat10,H,
24Scr,210711ballarat11,H,
25Scr,210711ballarat12,H,
26Scr,210711ballarat synthetic01,H,6,7,9,
27Scr,210711ballarat synthetic02,H,2,
28Scr,210711ballarat synthetic03,H,
29Scr,210711ballarat synthetic04,H,7,
30Scr,210711ballarat synthetic05,H,
31Scr,210711ballarat synthetic06,H,
32Scr,210711ballarat synthetic07,H,
33Scr,210711ballarat synthetic08,H,
34Scr,210711ballarat synthetic09,H,
35Scr,210711ballarat synthetic10,H,
36Scr,210711ballarat synthetic11,H,
37Scr,210711ballarat synthetic12,H,
38Scr,210713ballina01,H,
39Scr,210713ballina02,H,7,
40Scr,210713ballina03,H,
41Scr,210713ballina04,H,12,
42Scr,210713ballina05,H,
43Scr,210713ballina06,H,7,
44Scr,210713ballina07,H,
45Scr,210713ballina08,H,
46Scr,210713ballina09,H,
47Scr,210713ballina10,H,
48Scr,210713ballina11,H,
49Scr,210713ballina12,H,
50Scr,210710beaudesert01,H,
51Scr,210710beaudesert02,H,5,12,
52Scr,210710beaudesert03,H,6,
53Scr,210710beaudesert04,H,1,
54Scr,210710beaudesert05,H,7,9,
55Scr,210710beaudesert06,H,4,
56Scr,210710beaudesert07,H,7,11,
57Scr,210710beaudesert08,H,3,13,
58Scr,210710beaudesert09,H,
59Scr,210710beaudesert10,H,
60Scr,210710beaudesert11,H,
61Scr,210710beaudesert12,H,
62Scr,210710beaumont01,D,1,
63Scr,210710beaumont02,D,
64Scr,210710beaumont03,D,1,
65Scr,210710beaumont04,D,12,
66Scr,210710beaumont05,D,3,4,6,
67Scr,210710beaumont06,D,
68Scr,210710beaumont07,D,
69Scr,210710beaumont08,D,11,
70Scr,210710beaumont09,D,
71Scr,210710beaumont10,D,
72Scr,210710beaumont11,D,
73Scr,210710beaumont12,D,
74Scr,210710belmont01,S,
75Scr,210710belmont02,S,7,13,
76Scr,210710belmont03,S,
77Scr,210710belmont04,S,
78Scr,210710belmont05,S,
79Scr,210710belmont06,S,
80Scr,210710belmont07,S,
81Scr,210710belmont08,S,
82Scr,210710belmont09,S,2,17,
83Scr,210710belmont10,S,10,18,
84Scr,210710belmont11,S,
85Scr,210710belmont12,S,
86Scr,210710belmont park01,S,
87Scr,210710belmont park02,S,7,13,
88Scr,210710belmont park03,S,
89Scr,210710belmont park04,S,
90Scr,210710belmont park05,S,
91Scr,210710belmont park06,S,
92Scr,210710belmont park07,S,
93Scr,210710belmont park08,S,
94Scr,210710belmont park09,S,2,17,
95Scr,210710belmont park10,S,10,18,
96Scr,210710belmont park11,S,
97Scr,210710belmont park12,S,
98Scr,210710broome01,G,
99Scr,210710broome02,G,
100Scr,210710broome03,G,
101Scr,210710broome04,G,
102Scr,210710broome05,G,
103Scr,210710broome06,G,1,
104Scr,210710broome07,G,
105Scr,210710broome08,G,
106Scr,210710broome09,G,
107Scr,210710broome10,G,
108Scr,210710broome11,G,
109Scr,210710broome12,G,
110Scr,210710caulfield01,D,1,8,
111Scr,210710caulfield02,D,10,
112Scr,210710caulfield03,D,2,11,
113Scr,210710caulfield04,D,2,5,11,12,
114Scr,210710caulfield05,D,5,10,11,12,
115Scr,210710caulfield06,D,
116Scr,210710caulfield07,D,1,5,
117Scr,210710caulfield08,D,
118Scr,210710caulfield09,D,11,20,
119Scr,210710caulfield10,D,
120Scr,210710caulfield11,D,
121Scr,210710caulfield12,D,
122Scr,210710cowra01,S,12,
123Scr,210710cowra02,S,
124Scr,210710cowra03,S,8,9,
125Scr,210710cowra04,S,10,
126Scr,210710cowra05,S,
127Scr,210710cowra06,S,7,8,
128Scr,210710cowra07,S,
129Scr,210710cowra08,S,
130Scr,210710cowra09,S,
131Scr,210710cowra10,S,
132Scr,210710cowra11,S,
133Scr,210710cowra12,S,
134Scr,210710darwin01,G,
135Scr,210710darwin02,G,
136Scr,210710darwin03,G,
137Scr,210710darwin04,G,
138Scr,210710darwin05,G,
139Scr,210710darwin06,G,11,
140Scr,210710darwin07,G,
141Scr,210710darwin08,G,
142Scr,210710darwin09,G,
143Scr,210710darwin10,G,
144Scr,210710darwin11,G,
145Scr,210710darwin12,G,
146Scr,210711devonport synthetic01,G,6,
147Scr,210711devonport synthetic02,G,
148Scr,210711devonport synthetic03,G,5,
149Scr,210711devonport synthetic04,G,
150Scr,210711devonport synthetic05,G,
151Scr,210711devonport synthetic06,G,
152Scr,210711devonport synthetic07,G,
153Scr,210711devonport synthetic08,G,
154Scr,210711devonport synthetic09,G,2,
155Scr,210711devonport synthetic10,G,
156Scr,210711devonport synthetic11,G,
157Scr,210711devonport synthetic12,G,
158Scr,210710doomben01,S,
159Scr,210710doomben02,S,3,5,11,
160Scr,210710doomben03,S,4,5,9,10,14,
161Scr,210710doomben04,S,1,4,7,10,
162Scr,210710doomben05,S,2,10,13,14,17,19,
163Scr,210710doomben06,S,
164Scr,210710doomben07,S,9,12,15,
165Scr,210710doomben08,S,6,12,
166Scr,210710doomben09,S,10,
167Scr,210710doomben10,S,
168Scr,210710doomben11,S,
169Scr,210710doomben12,S,
170Scr,210710esk01,D,
171Scr,210710esk02,D,3,
172Scr,210710esk03,D,
173Scr,210710esk04,D,
174Scr,210710esk05,D,
175Scr,210710esk06,D,3,5,
176Scr,210710esk07,D,4,10,13,14,
177Scr,210710esk08,D,1,3,14,
178Scr,210710esk09,D,
179Scr,210710esk10,D,
180Scr,210710esk11,D,
181Scr,210710esk12,D,
182Scr,210710fannie bay01,G,
183Scr,210710fannie bay02,G,
184Scr,210710fannie bay03,G,
185Scr,210710fannie bay04,G,
186Scr,210710fannie bay05,G,
187Scr,210710fannie bay06,G,11,
188Scr,210710fannie bay07,G,
189Scr,210710fannie bay08,G,
190Scr,210710fannie bay09,G,
191Scr,210710fannie bay10,G,
192Scr,210710fannie bay11,G,
193Scr,210710fannie bay12,G,
194Scr,210710gawler01,D,8,
195Scr,210710gawler02,D,1,14,
196Scr,210710gawler03,D,
197Scr,210710gawler04,D,6,
198Scr,210710gawler05,D,3,9,12,
199Scr,210710gawler06,D,
200Scr,210710gawler07,D,1,
201Scr,210710gawler08,D,4,7,8,12,
202Scr,210710gawler09,D,2,4,
203Scr,210710gawler10,D,
204Scr,210710gawler11,D,
205Scr,210710gawler12,D,
206Scr,210709goulburn01,S,3,7,
207Scr,210709goulburn02,S,7,11,
208Scr,210709goulburn03,S,5,11,
209Scr,210709goulburn04,S,3,11,
210Scr,210709goulburn05,S,10,12,
211Scr,210709goulburn06,S,1,4,11,
212Scr,210709goulburn07,S,1,3,11,13,
213Scr,210709goulburn08,S,5,6,8,10,11,13,15,17,
214Scr,210709goulburn09,S,
215Scr,210709goulburn10,S,
216Scr,210709goulburn11,S,
217Scr,210709goulburn12,S,
218Scr,210711grafton01,S,
219Scr,210711grafton02,S,10,13,
220Scr,210711grafton03,S,8,
221Scr,210711grafton04,S,
222Scr,210711grafton05,S,1,2,
223Scr,210711grafton06,S,1,
224Scr,210711grafton07,S,
225Scr,210711grafton08,S,7,17,
226Scr,210711grafton09,S,
227Scr,210711grafton10,S,
228Scr,210711grafton11,S,
229Scr,210711grafton12,S,
230Scr,210711hawkesbury01,S,6,
231Scr,210711hawkesbury02,S,
232Scr,210711hawkesbury03,S,4,
233Scr,210711hawkesbury04,S,
234Scr,210711hawkesbury05,S,
235Scr,210711hawkesbury06,S,
236Scr,210711hawkesbury07,S,
237Scr,210711hawkesbury08,S,5,17,18,19,
238Scr,210711hawkesbury09,S,
239Scr,210711hawkesbury10,S,
240Scr,210711hawkesbury11,S,
241Scr,210711hawkesbury12,S,
242Scr,210710home hill01,D,
243Scr,210710home hill02,D,7,
244Scr,210710home hill03,D,
245Scr,210710home hill04,D,
246Scr,210710home hill05,D,
247Scr,210710home hill06,D,
248Scr,210710home hill07,D,
249Scr,210710home hill08,D,
250Scr,210710home hill09,D,
251Scr,210710home hill10,D,
252Scr,210710home hill11,D,
253Scr,210710home hill12,D,
254Scr,210712moruya01,S,
255Scr,210712moruya02,S,
256Scr,210712moruya03,S,
257Scr,210712moruya04,S,10,
258Scr,210712moruya05,S,
259Scr,210712moruya06,S,
260Scr,210712moruya07,S,
261Scr,210712moruya08,S,
262Scr,210712moruya09,S,
263Scr,210712moruya10,S,
264Scr,210712moruya11,S,
265Scr,210712moruya12,S,
266Scr,210710mount isa01,G,
267Scr,210710mount isa02,G,5,
268Scr,210710mount isa03,G,
269Scr,210710mount isa04,G,
270Scr,210710mount isa05,G,
271Scr,210710mount isa06,G,
272Scr,210710mount isa07,G,
273Scr,210710mount isa08,G,
274Scr,210710mount isa09,G,
275Scr,210710mount isa10,G,
276Scr,210710mount isa11,G,
277Scr,210710mount isa12,G,
278Scr,210710newcastle01,D,1,
279Scr,210710newcastle02,D,
280Scr,210710newcastle03,D,1,
281Scr,210710newcastle04,D,12,
282Scr,210710newcastle05,D,3,4,6,
283Scr,210710newcastle06,D,
284Scr,210710newcastle07,D,
285Scr,210710newcastle08,D,11,
286Scr,210710newcastle09,D,
287Scr,210710newcastle10,D,
288Scr,210710newcastle11,D,
289Scr,210710newcastle12,D,
290Scr,210710racing.com park syn01,G,
291Scr,210710racing.com park syn02,G,1,10,
292Scr,210710racing.com park syn03,G,1,5,8,11,14,
293Scr,210710racing.com park syn04,G,
294Scr,210710racing.com park syn05,G,
295Scr,210710racing.com park syn06,G,9,
296Scr,210710racing.com park syn07,G,
297Scr,210710racing.com park syn08,G,
298Scr,210710racing.com park syn09,G,
299Scr,210710racing.com park syn10,G,
300Scr,210710racing.com park syn11,G,
301Scr,210710racing.com park syn12,G,
302Scr,210710randwick01,S,3,6,14,
303Scr,210710randwick02,S,
304Scr,210710randwick03,S,7,13,17,
305Scr,210710randwick04,S,
306Scr,210710randwick05,S,5,
307Scr,210710randwick06,S,5,8,
308Scr,210710randwick07,S,
309Scr,210710randwick08,S,10,
310Scr,210710randwick09,S,6,15,
311Scr,210710randwick10,S,6,10,15,
312Scr,210710randwick11,S,
313Scr,210710randwick12,S,
314Scr,210710randwick-kensington01,S,3,6,14,
315Scr,210710randwick-kensington02,S,
316Scr,210710randwick-kensington03,S,7,13,17,
317Scr,210710randwick-kensington04,S,
318Scr,210710randwick-kensington05,S,5,
319Scr,210710randwick-kensington06,S,8,
320Scr,210710randwick-kensington07,S,
321Scr,210710randwick-kensington08,S,10,
322Scr,210710randwick-kensington09,S,6,15,
323Scr,210710randwick-kensington10,S,6,10,15,
324Scr,210710randwick-kensington11,S,
325Scr,210710randwick-kensington12,S,
326Scr,210709rockhampton01,D,4,12,
327Scr,210709rockhampton02,D,6,7,9,
328Scr,210709rockhampton03,D,3,
329Scr,210709rockhampton04,D,3,
330Scr,210709rockhampton05,D,5,
331Scr,210709rockhampton06,D,4,
332Scr,210709rockhampton07,D,9,13,15,
333Scr,210709rockhampton08,D,3,4,13,
334Scr,210709rockhampton09,D,
335Scr,210709rockhampton10,D,
336Scr,210709rockhampton11,D,
337Scr,210709rockhampton12,D,
338Scr,210710rockhampton01,D,5,6,8,
339Scr,210710rockhampton02,D,3,
340Scr,210710rockhampton03,D,1,
341Scr,210710rockhampton04,D,1,
342Scr,210710rockhampton05,D,3,14,
343Scr,210710rockhampton06,D,2,5,8,
344Scr,210710rockhampton07,D,
345Scr,210710rockhampton08,D,2,7,12,
346Scr,210710rockhampton09,D,
347Scr,210710rockhampton10,D,
348Scr,210710rockhampton11,D,
349Scr,210710rockhampton12,D,
350Scr,210710roebourne01,G,
351Scr,210710roebourne02,G,
352Scr,210710roebourne03,G,
353Scr,210710roebourne04,G,
354Scr,210710roebourne05,G,12,
355Scr,210710roebourne06,G,
356Scr,210710roebourne07,G,
357Scr,210710roebourne08,G,
358Scr,210710roebourne09,G,
359Scr,210710roebourne10,G,
360Scr,210710roebourne11,G,
361Scr,210710roebourne12,G,
362Scr,210709sale01,D,1,2,3,7,18,20,
363Scr,210709sale02,D,5,6,7,10,11,15,
364Scr,210709sale03,D,5,8,10,
365Scr,210709sale04,D,2,5,8,9,12,14,15,16,18,19,
366Scr,210709sale05,D,8,11,
367Scr,210709sale06,D,7,8,11,12,
368Scr,210709sale07,D,4,11,14,
369Scr,210709sale08,D,9,12,14,16,17,18,19,20,
370Scr,210709sale09,D,
371Scr,210709sale10,D,
372Scr,210709sale11,D,
373Scr,210709sale12,D,
374Scr,210709scone01,H,13,15,17,18,
375Scr,210709scone02,H,1,5,8,12,14,18,20,
376Scr,210709scone03,H,6,
377Scr,210709scone04,H,3,4,16,
378Scr,210709scone05,H,2,11,
379Scr,210709scone06,H,10,11,
380Scr,210709scone07,H,2,11,14,
381Scr,210709scone08,H,7,8,10,17,19,20,
382Scr,210709scone09,H,
383Scr,210709scone10,H,
384Scr,210709scone11,H,
385Scr,210709scone12,H,
386Scr,210711sunshine coast01,H,
387Scr,210711sunshine coast02,H,
388Scr,210711sunshine coast03,H,
389Scr,210711sunshine coast04,H,7,
390Scr,210711sunshine coast05,H,
391Scr,210711sunshine coast06,H,
392Scr,210711sunshine coast07,H,17,
393Scr,210711sunshine coast08,H,
394Scr,210711sunshine coast09,H,11,16,
395Scr,210711sunshine coast10,H,
396Scr,210711sunshine coast11,H,
397Scr,210711sunshine coast12,H,
398Scr,210713sunshine coast01,H,
399Scr,210713sunshine coast02,H,5,7,
400Scr,210713sunshine coast03,H,
401Scr,210713sunshine coast04,H,
402Scr,210713sunshine coast05,H,4,14,
403Scr,210713sunshine coast06,H,4,13,
404Scr,210713sunshine coast07,H,
405Scr,210713sunshine coast08,H,
406Scr,210713sunshine coast09,H,
407Scr,210713sunshine coast10,H,
408Scr,210713sunshine coast11,H,
409Scr,210713sunshine coast12,H,
410Scr,210711sunshine coast cushion01,H,
411Scr,210711sunshine coast cushion02,H,
412Scr,210711sunshine coast cushion03,H,
413Scr,210711sunshine coast cushion04,H,7,
414Scr,210711sunshine coast cushion05,H,
415Scr,210711sunshine coast cushion06,H,
416Scr,210711sunshine coast cushion07,H,17,
417Scr,210711sunshine coast cushion08,H,
418Scr,210711sunshine coast cushion09,H,11,16,
419Scr,210711sunshine coast cushion10,H,
420Scr,210711sunshine coast cushion11,H,
421Scr,210711sunshine coast cushion12,H,
422Scr,210713sunshine coast cushion01,H,
423Scr,210713sunshine coast cushion02,H,5,7,
424Scr,210713sunshine coast cushion03,H,
425Scr,210713sunshine coast cushion04,H,
426Scr,210713sunshine coast cushion05,H,4,14,
427Scr,210713sunshine coast cushion06,H,4,13,
428Scr,210713sunshine coast cushion07,H,
429Scr,210713sunshine coast cushion08,H,
430Scr,210713sunshine coast cushion09,H,
431Scr,210713sunshine coast cushion10,H,
432Scr,210713sunshine coast cushion11,H,
433Scr,210713sunshine coast cushion12,H,
434Scr,210711te aroha01,U,4,
435Scr,210711te aroha02,U,8,
436Scr,210711te aroha03,U,
437Scr,210711te aroha04,U,5,
438Scr,210711te aroha05,U,1,
439Scr,210711te aroha06,U,8,
440Scr,210711te aroha07,U,
441Scr,210711te aroha08,U,6,
442Scr,210711te aroha09,U,
443Scr,210711te aroha10,U,
444Scr,210711te aroha11,U,
445Scr,210711te aroha12,U,
446Scr,210710te rapa01,H,
447Scr,210710te rapa02,H,
448Scr,210710te rapa03,H,2,19,
449Scr,210710te rapa04,H,
450Scr,210710te rapa05,H,
451Scr,210710te rapa06,H,
452Scr,210710te rapa07,H,22,
453Scr,210710te rapa08,H,19,
454Scr,210710te rapa09,H,
455Scr,210710te rapa10,H,
456Scr,210710te rapa11,H,
457Scr,210710te rapa12,H,
458Scr,210710toowoomba01,S,
459Scr,210710toowoomba02,S,21,
460Scr,210710toowoomba03,S,11,13,
461Scr,210710toowoomba04,S,1,3,
462Scr,210710toowoomba05,S,4,
463Scr,210710toowoomba06,S,
464Scr,210710toowoomba07,S,6,9,
465Scr,210710toowoomba08,S,4,13,
466Scr,210710toowoomba09,S,
467Scr,210710toowoomba10,S,
468Scr,210710toowoomba11,S,
469Scr,210710toowoomba12,S,
470Scr,210710toowoomba cushion01,S,
471Scr,210710toowoomba cushion02,S,21,
472Scr,210710toowoomba cushion03,S,11,13,
473Scr,210710toowoomba cushion04,S,1,3,
474Scr,210710toowoomba cushion05,S,4,
475Scr,210710toowoomba cushion06,S,
476Scr,210710toowoomba cushion07,S,6,9,
477Scr,210710toowoomba cushion08,S,4,13,
478Scr,210710toowoomba cushion09,S,
479Scr,210710toowoomba cushion10,S,
480Scr,210710toowoomba cushion11,S,
481Scr,210710toowoomba cushion12,S,
482Scr,210710toowoomba cushion track01,S,
483Scr,210710toowoomba cushion track02,S,21,
484Scr,210710toowoomba cushion track03,S,11,13,
485Scr,210710toowoomba cushion track04,S,1,3,
486Scr,210710toowoomba cushion track05,S,4,
487Scr,210710toowoomba cushion track06,S,
488Scr,210710toowoomba cushion track07,S,6,9,
489Scr,210710toowoomba cushion track08,S,4,13,
490Scr,210710toowoomba cushion track09,S,
491Scr,210710toowoomba cushion track10,S,
492Scr,210710toowoomba cushion track11,S,
493Scr,210710toowoomba cushion track12,S,
494Scr,210709waverley01,H,
495Scr,210709waverley02,H,
496Scr,210709waverley03,H,
497Scr,210709waverley04,H,15,16,17,18,19,20,
498Scr,210709waverley05,H,5,
499Scr,210709waverley06,H,13,16,17,18,19,20,
500Scr,210709waverley07,H,4,13,14,15,16,
501Scr,210709waverley08,H,13,14,15,16,
502Scr,210709waverley09,H,13,14,15,16,17,18,
503Scr,210709waverley10,H,10,14,15,16,17,18,
504Scr,210709waverley11,H,
505Scr,210709waverley12,H,
506Scr,210711wodonga01,H,
507Scr,210711wodonga02,H,9,
508Scr,210711wodonga03,H,
509Scr,210711wodonga04,H,2,13,
510Scr,210711wodonga05,H,
511Scr,210711wodonga06,H,5,
512Scr,210711wodonga07,H,1,
513Scr,210711wodonga08,H,
514Scr,210711wodonga09,H,
515Scr,210711wodonga10,H,
516Scr,210711wodonga11,H,
517Scr,210711wodonga12,H,
518End
GetAllScratchingsText



What I need to be able to do is extract the characters from the RHS after the "H," or "S," or "G," or whatever letter, but I need to keep the result as string for later use.

So from "Scr,210710awapuni03,H," the result would be null, while from "Scr,210711ballarat01,H,6,7,9," the result would be 6,7,9 - without any leading or trailing commas.

I guess I could parse them into separate cells, then add them back to together later, but that just seems inefficient.

Any guidance would be great.

Thanks in advance
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
try this for A2
=LEFT(MID(A2,FIND(",",A2,10)+3,99),LEN(MID(A2,FIND(",",A2,10)+3,99))-1)
if you didn't need to get rid of the trailing comma, it would be simpler
=MID(A2,FIND(",",A2,10)+3,99)

If you have Office 365, you could try
=LET(txt,MID(A2,FIND(",",A2,10)+3,99),LEFT(txt,LEN(txt)-1))
 
Upvote 0
Solution
Hi JeffGrant,

As @Dermot says, that training comma makes it messy but here's my approach.

JeffGrant.xlsx
AB
1Auto Scratchings File
2Scr,210710awapuni01,H,7,7
3Scr,210710awapuni02,H, 
4Scr,210710awapuni03,H, 
5Scr,210710awapuni04,H, 
6Scr,210710awapuni05,H,5,5
7Scr,210710awapuni06,H,1,1
8Scr,210710awapuni07,H,15,16,15,16
9Scr,210710awapuni08,H, 
10Scr,210710awapuni09,H, 
Sheet1
Cell Formulas
RangeFormula
B2:B10B2=SUBSTITUTE(LEFT(A2,LEN(A2)-1),LEFT(LEFT(A2,LEN(A2)-1),SEARCH(",",LEFT(A2,LEN(A2)-1),5)+2),"")
 
Upvote 0
Thanks Toadstool and Dermot. All three solutions work great and I am glad to see more than one way to solve this one. Because I have 365, I will use Dermot's 365 solution wrapped in an Iferror statement.

Have a good weekend.
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,048
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top