Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
brian
 
Posts: n/a
Default switch number order

i'm trying to figure out if there is any way to switch a column of 6 digit
numbers so that the first 3 numbers are the last 3 and vise versa. example..
111222=222111, or 198321=321198. any help would be welcomed. thanks for
your time.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Franz Verga
 
Posts: n/a
Default switch number order

Nel post
*brian* ha scritto:

i'm trying to figure out if there is any way to switch a column of 6
digit numbers so that the first 3 numbers are the last 3 and vise
versa. example.. 111222=222111, or 198321=321198. any help would be
welcomed. thanks for your time.



Hi Brian.

If you want a number to use in calculation use the formula:

=VALUE(RIGHT(A22,3)&LEFT(A22,3))

instead, if you need just a string, you can use the formula:

=RIGHT(A22,3)&LEFT(A22,3)


--
(I'm not sure of names of menues, option and commands, because
translating from the Italian version of Excel...)

Hope I helped you.

Ciao

Franz Verga from Italy


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
VBA Noob
 
Posts: n/a
Default switch number order


Here's a helpful bit of VBA code

Option Explicit

Function Reverse(InString) As Variant
' If a string, returns its argument, reversed
' Otherwise returns #N/A error
Dim StringLength As Integer
Dim i As Integer

If Application.WorksheetFunction.IsText(InString) Then
Reverse = ""
StringLength = Len(InString)
For i = StringLength To 1 Step -1
Reverse = Reverse & Mid(InString, i, 1)
Next i
Else
Reverse = CVErr(xlErrNA)
End If
End Function

Press alt F11. Insert a module and paste code. Next enter
=reverse(A1)...Change (A1) as required

VBA Noob


--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=554309

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin Vaughn
 
Posts: n/a
Default switch number order

I won't be surprised if someone comes up with a more elegant solution, but
this seems to work:

=VALUE(MID(A1,6,1)&MID(A1,5,1)&MID(A1,4,1)&MID(A1, 3,1)&MID(A1,2,1)&MID(A1,1,1))

I assumed you would probably want to keep them as numbers therefore the
value function.
--
Kevin Vaughn


"brian" wrote:

i'm trying to figure out if there is any way to switch a column of 6 digit
numbers so that the first 3 numbers are the last 3 and vise versa. example..
111222=222111, or 198321=321198. any help would be welcomed. thanks for
your time.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default switch number order

Hi Brian

With the number to be reversed in cell A1, try

=SUMPRODUCT(--(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),
(10^(ROW(INDIRECT("1:"&LEN(A1)))))/10)

--
Regards

Roger Govier


"brian" wrote in message
...
i'm trying to figure out if there is any way to switch a column of 6
digit
numbers so that the first 3 numbers are the last 3 and vise versa.
example..
111222=222111, or 198321=321198. any help would be welcomed. thanks
for
your time.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin Vaughn
 
Posts: n/a
Default switch number order

oops, I misunderstood. I thought you were trying to reverse the order.
Disregard this post.
--
Kevin Vaughn


"Kevin Vaughn" wrote:

I won't be surprised if someone comes up with a more elegant solution, but
this seems to work:

=VALUE(MID(A1,6,1)&MID(A1,5,1)&MID(A1,4,1)&MID(A1, 3,1)&MID(A1,2,1)&MID(A1,1,1))

I assumed you would probably want to keep them as numbers therefore the
value function.
--
Kevin Vaughn


"brian" wrote:

i'm trying to figure out if there is any way to switch a column of 6 digit
numbers so that the first 3 numbers are the last 3 and vise versa. example..
111222=222111, or 198321=321198. any help would be welcomed. thanks for
your time.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default switch number order

Hi Brian

I may have misunderstood your request. My solution was for changing the
order of numbers in a cell.
If your data is in individual cells, going down column A, and you want
them reveres in column B, then try entering in B1
=INDEX($A$1:$A$100,COUNT(A$1:$A$100)+1-ROW(1:1))
and copy down column B as required

--
Regards

Roger Govier


"Roger Govier" wrote in message
...
Hi Brian

With the number to be reversed in cell A1, try

=SUMPRODUCT(--(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),
(10^(ROW(INDIRECT("1:"&LEN(A1)))))/10)

--
Regards

Roger Govier


"brian" wrote in message
...
i'm trying to figure out if there is any way to switch a column of 6
digit
numbers so that the first 3 numbers are the last 3 and vise versa.
example..
111222=222111, or 198321=321198. any help would be welcomed. thanks
for
your time.





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RWS
 
Posts: n/a
Default switch number order

If you try this

=RIGHT(a1,3)&LEFT(a1,3), and drag for entire range
it will return your number as a text format only, so you cant work with it

Then select the new data, copy and paste Special into the same place, then
click on the little yellow warning marker and convert to number


--
RWS


"Roger Govier" wrote:

Hi Brian

I may have misunderstood your request. My solution was for changing the
order of numbers in a cell.
If your data is in individual cells, going down column A, and you want
them reveres in column B, then try entering in B1
=INDEX($A$1:$A$100,COUNT(A$1:$A$100)+1-ROW(1:1))
and copy down column B as required

--
Regards

Roger Govier


"Roger Govier" wrote in message
...
Hi Brian

With the number to be reversed in cell A1, try

=SUMPRODUCT(--(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),
(10^(ROW(INDIRECT("1:"&LEN(A1)))))/10)

--
Regards

Roger Govier


"brian" wrote in message
...
i'm trying to figure out if there is any way to switch a column of 6
digit
numbers so that the first 3 numbers are the last 3 and vise versa.
example..
111222=222111, or 198321=321198. any help would be welcomed. thanks
for
your time.






  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dana DeLouis
 
Posts: n/a
Default switch number order

Here's two of many options, assuming they are indeed 6 digit numbers.

=MOD(A1,1000)*1000+INT(A1/1000)
=--(RIGHT(A2,3) & LEFT(A2,3))

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"brian" wrote in message
...
i'm trying to figure out if there is any way to switch a column of 6 digit
numbers so that the first 3 numbers are the last 3 and vise versa.
example..
111222=222111, or 198321=321198. any help would be welcomed. thanks for
your time.



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
Need a formula to create an order number slorryy Excel Worksheet Functions 5 May 8th 06 01:41 AM
Preceding a number by zeros, that is still a number Michele Excel Worksheet Functions 1 September 14th 05 01:06 PM
how, in excel, can i generate a number, eg consecutive order nos Verity55 Excel Discussion (Misc queries) 1 June 24th 05 11:42 AM
Is there a way to switch name order in an Excel column? makocako Excel Discussion (Misc queries) 1 March 9th 05 01:53 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 12:13 AM.

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

About Us

"It's about Microsoft Excel"