Share via

extract data between two comma

Anonymous
2011-04-14T10:02:50+00:00
102,34112,021502503130010010000,QAR,1,24,1,{NULL:0},{5:Y},6,14.5,31-MAR-2011

above data is in one cell , i want to extract the data between second and third comma.

im using this formula =MID(A1,FIND(",",A1),(FIND(",",A1,5))-(FIND(",",A1)))

but i am looking for some thing simple ???

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-04-14T10:25:36+00:00
102,34112,021502503130010010000,QAR,1,24,1,{NULL:0},{5:Y},6,14.5,31-MAR-2011

 

above data is in one cell , i want to extract the data between second and third comma.

im using this formula =MID(A1,FIND(",",A1),(FIND(",",A1,5))-(FIND(",",A1)))

but i am looking for some thing simple ???

hi,

I doin't think this is simpler but it's a lot more flexible. It will extract any set of data between commas by simply changing the 2 towards the end of the formula. The 2 in this case makes it extract the second set of data

=SUBSTITUTE(MID(SUBSTITUTE("," & A2&REPT(" ",6),",",REPT(",",255)),2*255,255),",","")

Was this answer helpful?

0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2011-04-14T10:44:22+00:00

    That's perfectly flexible. but a way too complicated. Need something to remember on fingertips.

    Then; Like you, I'll wait for someone to post it<g>

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-04-14T10:40:17+00:00

    That's perfectly flexible. but a way too complicated. Need something to remember on fingertips.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2011-04-14T10:31:34+00:00

    You could use a VBA function such as

    Function SplitString(ST As String, Item As Integer) As Variant

      SplitString = Split(ST, ",")(Item - 1)

    End Function

    and enter

    =SplitString(A1,2)

    Was this answer helpful?

    0 comments No comments