ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   move first two digit to right (https://www.excelbanter.com/excel-discussion-misc-queries/254231-move-first-two-digit-right.html)

TFMR

move first two digit to right
 
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

Mike H

move first two digit to right
 
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


Lars-Åke Aspelin[_2_]

move first two digit to right
 
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

Per Jessen

move first two digit to right
 
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



TFMR

move first two digit to right
 
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


Mike H

move first two digit to right
 
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


Joe User[_2_]

move first two digit to right
 
"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



All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com