#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 78
Default Invert a column

I need to invert the data in a column. The column is a mixture of text
numbers and blanks. Here is a small example in col A

a1:
a2: ssn
a3: 123
a4: 45
a5: 6789
a6:
a7:
a8: tel
a9: 189xx
a10: 276xx

What I need in col B

b1: 276xx
b2: 189xx
b3: tel
b4:
b5:
b6: 6789
b7: 45
b8: 123
b9: ssn
b10:

I am now doing this manually by first copying col A to col B, and then I put
in a col of numbers like 1,2,3,4,€¦, and then I sort by this new col in
descending order.

I have to repeat this every time col A is changed.

Is there a formula I can put in col B which could figure out where the last
col A value is and to automatically do this for me?

Thanks in advance for any help.

--
jake
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Invert a column

you could try this in B1 and copy down as far as needed

=INDEX(A:A,LOOKUP(2,1/($A$1:$A$65535<""),ROW($A$1:$A$65535))-ROWS(B$1:B1)+1)

although it will return a 0 for empty cells (which can be hidden by using a
custom format, such as General;General;;General).



"Jakobshavn Isbrae" wrote:

I need to invert the data in a column. The column is a mixture of text
numbers and blanks. Here is a small example in col A

a1:
a2: ssn
a3: 123
a4: 45
a5: 6789
a6:
a7:
a8: tel
a9: 189xx
a10: 276xx

What I need in col B

b1: 276xx
b2: 189xx
b3: tel
b4:
b5:
b6: 6789
b7: 45
b8: 123
b9: ssn
b10:

I am now doing this manually by first copying col A to col B, and then I put
in a col of numbers like 1,2,3,4,€¦, and then I sort by this new col in
descending order.

I have to repeat this every time col A is changed.

Is there a formula I can put in col B which could figure out where the last
col A value is and to automatically do this for me?

Thanks in advance for any help.

--
jake

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 78
Default Invert a column

Thank you very much. I don't think the problem of blanks showing as zeros is
crucial.

By the way, your suggestion of using the special format hides both real
zeros and zeros-as-blanks
--
jake


"JMB" wrote:

you could try this in B1 and copy down as far as needed

=INDEX(A:A,LOOKUP(2,1/($A$1:$A$65535<""),ROW($A$1:$A$65535))-ROWS(B$1:B1)+1)

although it will return a 0 for empty cells (which can be hidden by using a
custom format, such as General;General;;General).



"Jakobshavn Isbrae" wrote:

I need to invert the data in a column. The column is a mixture of text
numbers and blanks. Here is a small example in col A

a1:
a2: ssn
a3: 123
a4: 45
a5: 6789
a6:
a7:
a8: tel
a9: 189xx
a10: 276xx

What I need in col B

b1: 276xx
b2: 189xx
b3: tel
b4:
b5:
b6: 6789
b7: 45
b8: 123
b9: ssn
b10:

I am now doing this manually by first copying col A to col B, and then I put
in a col of numbers like 1,2,3,4,€¦, and then I sort by this new col in
descending order.

I have to repeat this every time col A is changed.

Is there a formula I can put in col B which could figure out where the last
col A value is and to automatically do this for me?

Thanks in advance for any help.

--
jake

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Invert a column

Try this:

=IF(INDEX(DATA,ROWS(DATA)-ROWS($1:1)+1)=0,"",INDEX(DATA,ROWS(DATA)-ROWS($1:1)+1))


"Jakobshavn Isbrae" wrote:

I need to invert the data in a column. The column is a mixture of text
numbers and blanks. Here is a small example in col A

a1:
a2: ssn
a3: 123
a4: 45
a5: 6789
a6:
a7:
a8: tel
a9: 189xx
a10: 276xx

What I need in col B

b1: 276xx
b2: 189xx
b3: tel
b4:
b5:
b6: 6789
b7: 45
b8: 123
b9: ssn
b10:

I am now doing this manually by first copying col A to col B, and then I put
in a col of numbers like 1,2,3,4,€¦, and then I sort by this new col in
descending order.

I have to repeat this every time col A is changed.

Is there a formula I can put in col B which could figure out where the last
col A value is and to automatically do this for me?

Thanks in advance for any help.

--
jake

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Invert a column

I should note that I was assuming the range in column A was changing often so
did not hardcode the column A range reference into the formula. If your data
set is very large, I am sure you will have problems w/calculation speed. In
which case you should consider Teethless Mama's suggestion (I reposted it
below):

=IF(INDEX(DATA,ROWS(DATA)-ROWS($1:1)+1)="","",INDEX(DATA,ROWS(DATA)-ROWS($1:1)+1))



"Jakobshavn Isbrae" wrote:

Thank you very much. I don't think the problem of blanks showing as zeros is
crucial.

By the way, your suggestion of using the special format hides both real
zeros and zeros-as-blanks
--
jake


"JMB" wrote:

you could try this in B1 and copy down as far as needed

=INDEX(A:A,LOOKUP(2,1/($A$1:$A$65535<""),ROW($A$1:$A$65535))-ROWS(B$1:B1)+1)

although it will return a 0 for empty cells (which can be hidden by using a
custom format, such as General;General;;General).



"Jakobshavn Isbrae" wrote:

I need to invert the data in a column. The column is a mixture of text
numbers and blanks. Here is a small example in col A

a1:
a2: ssn
a3: 123
a4: 45
a5: 6789
a6:
a7:
a8: tel
a9: 189xx
a10: 276xx

What I need in col B

b1: 276xx
b2: 189xx
b3: tel
b4:
b5:
b6: 6789
b7: 45
b8: 123
b9: ssn
b10:

I am now doing this manually by first copying col A to col B, and then I put
in a col of numbers like 1,2,3,4,€¦, and then I sort by this new col in
descending order.

I have to repeat this every time col A is changed.

Is there a formula I can put in col B which could figure out where the last
col A value is and to automatically do this for me?

Thanks in advance for any help.

--
jake



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Invert a column

This formula is a little shorter.
Enter it *anywhere*, and copy down 10 rows:

=INDEX($A$1:$A$10,ROWS(1:$10))

Revise to match your actual range!
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Jakobshavn Isbrae" wrote in
message ...
Thank you very much. I don't think the problem of blanks showing as zeros
is
crucial.

By the way, your suggestion of using the special format hides both real
zeros and zeros-as-blanks
--
jake


"JMB" wrote:

you could try this in B1 and copy down as far as needed

=INDEX(A:A,LOOKUP(2,1/($A$1:$A$65535<""),ROW($A$1:$A$65535))-ROWS(B$1:B1)+1)

although it will return a 0 for empty cells (which can be hidden by using
a
custom format, such as General;General;;General).



"Jakobshavn Isbrae" wrote:

I need to invert the data in a column. The column is a mixture of text
numbers and blanks. Here is a small example in col A

a1:
a2: ssn
a3: 123
a4: 45
a5: 6789
a6:
a7:
a8: tel
a9: 189xx
a10: 276xx

What I need in col B

b1: 276xx
b2: 189xx
b3: tel
b4:
b5:
b6: 6789
b7: 45
b8: 123
b9: ssn
b10:

I am now doing this manually by first copying col A to col B, and then
I put
in a col of numbers like 1,2,3,4,., and then I sort by this new col in
descending order.

I have to repeat this every time col A is changed.

Is there a formula I can put in col B which could figure out where the
last
col A value is and to automatically do this for me?

Thanks in advance for any help.

--
jake



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
invert Lines and column on Excel Dhfan Excel Discussion (Misc queries) 3 February 23rd 07 07:41 PM
How do I invert a column of numbers? (make the 1st last, etc) Glockner Excel Discussion (Misc queries) 2 October 16th 06 11:41 PM
reverse or invert column data Eggle Excel Worksheet Functions 1 October 4th 06 01:13 AM
how do you invert a column Chris Excel Discussion (Misc queries) 7 August 21st 06 11:42 PM
How do I invert a column in Excel? 3-togo Excel Discussion (Misc queries) 1 February 8th 06 03:27 PM


All times are GMT +1. The time now is 04:51 AM.

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"