I have a column of cells, each of which contains five numbers separated by spaces, e.g., 11 8 10 5 8. Is it possible to write a formula that would select either the first number, "11" or the second number "8"?
Thank you for any help.
I have a column of cells, each of which contains five numbers separated by spaces, e.g., 11 8 10 5 8. Is it possible to write a formula that would select either the first number, "11" or the second number "8"?
Thank you for any help.
The first number is given by:
=--LEFT(A1,FIND(" ",A1)-1)
You can get the second number with this:
=--MID(A1,FIND(" ",A1)+1,2)
assuming your numbers are no more than two digits long.
Hope this helps.
Pete
Hi, welcome to the forum
Try this...
A B C 111 8 10 5 8 5 8
A1=youer "number"
B1=the number you want to find
C1=--IF(B1=1,LEFT(A1,2),MID(A1,FIND("xx",SUBSTITUTE(A1," ","xx",B1-1),1)+1,2))
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
For similar layout shown by FDibbins
change value in B1
=--TRIM(MID(SUBSTITUTE(" "&A1," ",REPT(" ",25)),25*B1,25))
Last edited by AlKey; 01-17-2015 at 05:32 PM.
If you like my answer please click on * Add Reputation
Don't forget to mark threads as "Solved" if your problem has been resolved
"Nothing is so firmly believed as what we least know."
--Michel de Montaigne
Pete's solution works best for me. Thank you.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks