Extract all text from a string with numbers and characters

lawi227

Board Regular
Joined
Mar 17, 2016
Messages
123
Hello All,

I have a column of seat (arena) data. The data contains section numbers and rows. I want to extract the section numbers into 1 column and the row (letters) into another column.

Here's an example of my data set:
[TABLE="width: 368"]
<colgroup><col></colgroup><tbody>[TR]
[TD]104 BB[/TD]
[/TR]
[TR]
[TD]103 & 105 BB[/TD]
[/TR]
[TR]
[TD]104 CC[/TD]
[/TR]
[TR]
[TD]103 & 105 CC / 104 DD[/TD]
[/TR]
[TR]
[TD]103 & 105 DD / 107 BB / 106 & 102 BB, CC[/TD]
[/TR]
[TR]
[TD]103 & 105 FWA - FWC

There is no consistency in the formatting so I don't believe I can do "text to column." I'm also going to need to clean up the data after I separate the numbers and the letters.
[/TD]
[/TR]
</tbody>[/TABLE]
 
Check if this formula works well with your data (the formula is entered in cell D2 of Sheet 1 with Ctrl + Shift + Enter, not just Enter):
Excel Workbook
ABCD
1SectionRowSeat #Amount
2103BB318500
3103CC317000
4104BB319500
5104CC318000
6104DD317000
7105BB318500
8105CC317000
9105DD317000
10106XXNO DATA
Sheet

In post #5 there are double spaces between the data resulted. They can be substituted with UDFs which produce only one space between the data, but it is not neccessary when using the formula in this post.
 
Upvote 0
Check if this formula works well with your data (the formula is entered in cell D2 of Sheet 1 with Ctrl + Shift + Enter, not just Enter):
*ABCD
BB
CC
BB
CC
DD
BB
CC
DD
XX*NO DATA

<tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]
[TD="align: center"]Section[/TD]
[TD="align: center"]Row[/TD]
[TD="align: center"]Seat #[/TD]
[TD="align: center"]Amount[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="align: right"]103[/TD]

[TD="align: right"]3[/TD]
[TD="align: right"]18500[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]
[TD="align: right"]103[/TD]

[TD="align: right"]3[/TD]
[TD="align: right"]17000[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]
[TD="align: right"]104[/TD]

[TD="align: right"]3[/TD]
[TD="align: right"]19500[/TD]

[TD="bgcolor: #cacaca, align: center"]5[/TD]
[TD="align: right"]104[/TD]

[TD="align: right"]3[/TD]
[TD="align: right"]18000[/TD]

[TD="bgcolor: #cacaca, align: center"]6[/TD]
[TD="align: right"]104[/TD]

[TD="align: right"]3[/TD]
[TD="align: right"]17000[/TD]

[TD="bgcolor: #cacaca, align: center"]7[/TD]
[TD="align: right"]105[/TD]

[TD="align: right"]3[/TD]
[TD="align: right"]18500[/TD]

[TD="bgcolor: #cacaca, align: center"]8[/TD]
[TD="align: right"]105[/TD]

[TD="align: right"]3[/TD]
[TD="align: right"]17000[/TD]

[TD="bgcolor: #cacaca, align: center"]9[/TD]
[TD="align: right"]105[/TD]

[TD="align: right"]3[/TD]
[TD="align: right"]17000[/TD]

[TD="bgcolor: #cacaca, align: center"]10[/TD]
[TD="align: right"]106[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
D2{=IFERROR(INDEX(Sheet2!E$2:E$5,MATCH(1,ISNUMBER(SEARCH(A2,Sheet2!C$2:C$5))*ISNUMBER(SEARCH(B2,Sheet2!D$2:D$5)),0)),"NO DATA")}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
In post #5 there are double spaces between the data resulted. They can be substituted with UDFs which produce only one space between the data, but it is not neccessary when using the formula in this post.




This worked great, except somehow whenever there is an error, #VALUE shows up instead of "Check Your Inputs" which I altered. I also multiplied E18, but that should have an impact. I also made sure to do CTRL+SHIFT+ENTER.

=IFERROR(INDEX('Ticket Info'!E$2:E$53,MATCH(1,ISNUMBER(SEARCH(F18,'Ticket Info'!C$2:C$53))*ISNUMBER(SEARCH(G18,'Ticket Info'!D$2:D$53)),0)),"Check Your Inputs")*E18


Any advice on how to fix it? It was working not that long ago.


EDIT:

Note: I just realized that by multiplying E18 to the equation, that is what is creating the VALUE problem.

Your equation works great for pulling the amount, however, if I buy 2 tickets, I need to take the amount that your formula pulls and multiply it by 2. The number of tickets is found in Column E.
 
Last edited:
Upvote 0
I think you need something similar; if it is the user who enters the number of tickets you should validate that the number entered is a positive integer.
Excel Workbook
ABCDEF
1SectionRowSeat #Price/ticketNumber of ticketsTotal
2103BB318500237000
3103CC317000117000
4104BB319500358500
5104CC318000472000
6104DD317000234000
7105BB318500118500
8105CC317000351000
9105DD317000234000
10106XX3Check Your Input
111030CC3Check Your Input
Sheet
 
Upvote 0
I was trying to avoid having another column, but this will work! Thanks so much for your help! I learned some new formulas!
 
Upvote 0

Forum statistics

Threads
1,226,856
Messages
6,193,377
Members
453,792
Latest member
Vic001

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