Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 913
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default 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


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
move each digit of a cell to its own individual cell holimont Excel Discussion (Misc queries) 1 July 29th 09 05:41 PM
Convert 2 digit month to 4 digit years and months BB Excel Worksheet Functions 2 September 17th 06 09:33 PM
Color a single digit in a mult-digit number cell Phyllis Excel Discussion (Misc queries) 6 November 17th 05 12:46 AM
Tell users how to sort 5 digit and 9 digit zipcodes correctly aft. [email protected] New Users to Excel 1 February 18th 05 12:59 AM
When we enter a 16 digit number (credit card) the last digit chan. ceking Excel Discussion (Misc queries) 5 December 8th 04 11:45 PM


All times are GMT +1. The time now is 06:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"