Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dear All,
I have a list of nos. 4-12456 and so on. I want to move first two character to end of cell value like 12456-4. Thanks & Regards Hassan |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
We could have done with a few more examples but this works for your posted one =MID(A1,3,LEN(A1))&MID(A1,2,1)&LEFT(A1,1) -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "TFMR" wrote: Dear All, I have a list of nos. 4-12456 and so on. I want to move first two character to end of cell value like 12456-4. Thanks & Regards Hassan |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Sun, 24 Jan 2010 01:51:01 -0800, TFMR
wrote: Dear All, I have a list of nos. 4-12456 and so on. I want to move first two character to end of cell value like 12456-4. Thanks & Regards Hassan If you input is in cell A1, try the following in the cell where you want to have your output: =RIGHT(A1,LEN(A1)-2)&MID(A1,2,1)&LEFT(A1) Hope this helps / Lars-Åke |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Hassan
=MID(A1,3,99)&"-"&LEFT(A1,1) Note that 99 is just an arbitrary number, which has to be equal to or larger than your text string less two. Regards, Per "TFMR" skrev i meddelelsen ... Dear All, I have a list of nos. 4-12456 and so on. I want to move first two character to end of cell value like 12456-4. Thanks & Regards Hassan |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Mike,
Its really help me, but there is one more query that if there is only five digit without hypen "-" then return will be same. "Mike H" wrote: Hi, We could have done with a few more examples but this works for your posted one =MID(A1,3,LEN(A1))&MID(A1,2,1)&LEFT(A1,1) -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "TFMR" wrote: Dear All, I have a list of nos. 4-12456 and so on. I want to move first two character to end of cell value like 12456-4. Thanks & Regards Hassan |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
As I said in my last post We could have done with a few more examples Give examples of before and after and someone will come up with a generic solution. There is no point in guessing further as to what your data looks like -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "TFMR" wrote: Thanks Mike, Its really help me, but there is one more query that if there is only five digit without hypen "-" then return will be same. "Mike H" wrote: Hi, We could have done with a few more examples but this works for your posted one =MID(A1,3,LEN(A1))&MID(A1,2,1)&LEFT(A1,1) -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "TFMR" wrote: Dear All, I have a list of nos. 4-12456 and so on. I want to move first two character to end of cell value like 12456-4. Thanks & Regards Hassan |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
"TFMR" wrote:
Its really help me, but there is one more query that if there is only five digit without hypen "-" then return will be same. You are not being very clear about your requirements. If you strings are only of the form x-xxxxx and xxxxx, then the following should suffice: =if(len(A1)=5, A1, mid(A1,3,5) & "-" & left(A1)) Note: Change MID(A1,3,5) to MID(A1,3,99) if strings that start with "x-" might be longer than 7 characters. ----- original message ----- "TFMR" wrote: Thanks Mike, Its really help me, but there is one more query that if there is only five digit without hypen "-" then return will be same. "Mike H" wrote: Hi, We could have done with a few more examples but this works for your posted one =MID(A1,3,LEN(A1))&MID(A1,2,1)&LEFT(A1,1) -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "TFMR" wrote: Dear All, I have a list of nos. 4-12456 and so on. I want to move first two character to end of cell value like 12456-4. Thanks & Regards Hassan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
move each digit of a cell to its own individual cell | Excel Discussion (Misc queries) | |||
Convert 2 digit month to 4 digit years and months | Excel Worksheet Functions | |||
Color a single digit in a mult-digit number cell | Excel Discussion (Misc queries) | |||
Tell users how to sort 5 digit and 9 digit zipcodes correctly aft. | New Users to Excel | |||
When we enter a 16 digit number (credit card) the last digit chan. | Excel Discussion (Misc queries) |