Log in

View Full Version : (Microsoft Excel) - Need to extract a specific number from text string


winningeleven9
Jan 18, 2010, 07:16 PM
For example, cell K1 looks like this

Z. Thornton(90), J. Bornstein(90), A. Jazic(65), C. Talley(90), Y. Cuesta(90), S. Kljestan(90), P. Nagamura(90), M. Lahoud(90), J. Braun(90), J. Padilla(46), Maicon Santos(60)

I want a formula that will give me the number to the right of a name if the cell contains that name. So something like "if K1 contains A. Jazic then find the number to the right of his name (65) without the brackets, if not, leave the cell blank

Thanks!

JBeaucaire
Jan 19, 2010, 12:37 PM
If K1 holds your string as shown above...
If A1 holds the name string to match...
If the numbers are all 2-digits...

Put this formula in B1:
=IF(ISNUMBER(SEARCH(A1, K1)), MID(K1, FIND("(", K1, SEARCH(A1, K1)) + 1, 2), "")

winningeleven9
Jan 19, 2010, 05:06 PM
If K1 holds your string as shown above...
If A1 holds the name string to match...
If the numbers are all 2-digits...

Put this formula in B1:
=IF(ISNUMBER(SEARCH(A1, K1)), MID(K1, FIND("(", K1, SEARCH(A1, K1)) + 1, 2), "")

That works! Thanks!