Selecting Text Between Commas in Excel

B

Brian

Hello everybody,

I have data in an excel cell setup as follows:
unimportantData, dataToBeExtracted, unimportantData2, unimportantData3

I would like to extract the information "dataToBeExtracted", and had
considered using the MID function. However, the string length of
dataToBeExtracted is different for each row. Is there a way to get
Excel to read all data after the first comma, but before the second
(without a bunch of IF((MID,#,#)=",")'s that is (unless that's the best
way!))?

Thanks in advance for your help. Have a great day!
Brian
 
J

JE McGimpsey

One way:

=MID(LEFT(A1,FIND("#",SUBSTITUTE(A1,",","#",2))-1), FIND(",",A1)+1,
255)

where 255 is just a large enough number to contain the data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top