Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Copy a column dependant on a the contents of a cell

I wish to copy a column from one of several worksheets to a summary sheet
dependant upon the month.
EG. If cell A1 in the summary sheet contained January I would wish to copy
column c from the January sheet to column b of the summary sheet.
I really could do with some suggestions on how to achieve this.

Thanks in advance
Peter


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Copy a column dependant on a the contents of a cell

One way:

=IF(A$1="","",IF(INDEX(INDIRECT(A$1&"!C:C"),ROWS($ 1:1))="","",INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:1)) ))

Copy down as needed.

Biff

"Peter" wrote in message
...
I wish to copy a column from one of several worksheets to a summary sheet
dependant upon the month.
EG. If cell A1 in the summary sheet contained January I would wish to copy
column c from the January sheet to column b of the summary sheet.
I really could do with some suggestions on how to achieve this.

Thanks in advance
Peter



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Copy a column dependant on a the contents of a cell

Thanks very much Biff, works a treat but I cannot follow why it works,
Many thanks
Peter
"T. Valko" wrote in message
...
One way:

=IF(A$1="","",IF(INDEX(INDIRECT(A$1&"!C:C"),ROWS($ 1:1))="","",INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:1)) ))

Copy down as needed.

Biff

"Peter" wrote in message
...
I wish to copy a column from one of several worksheets to a summary sheet
dependant upon the month.
EG. If cell A1 in the summary sheet contained January I would wish to
copy column c from the January sheet to column b of the summary sheet.
I really could do with some suggestions on how to achieve this.

Thanks in advance
Peter





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Copy a column dependant on a the contents of a cell

Most of the formula is taken up by testing for empty/blank cells:

=IF(A$1="","",IF(INDEX(INDIRECT(A$1&"!C:C"),ROWS($ 1:1))="","",

If A1 (cell holding month name) was empty that would cause the formula to
error. If the target cells on the target sheet are empty then the formula
would return 0's. I assumed you didn't want either of those situations to
occur.

INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:1)))

As you drag copy down, the ROWS($1:1) argument will increment like this:

INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:1))) = C1
INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:2))) = C2
INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:3))) = C3
INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:4))) = C4
etc
etc

Biff

"Peter" wrote in message
...
Thanks very much Biff, works a treat but I cannot follow why it works,
Many thanks
Peter
"T. Valko" wrote in message
...
One way:

=IF(A$1="","",IF(INDEX(INDIRECT(A$1&"!C:C"),ROWS($ 1:1))="","",INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:1)) ))

Copy down as needed.

Biff

"Peter" wrote in message
...
I wish to copy a column from one of several worksheets to a summary sheet
dependant upon the month.
EG. If cell A1 in the summary sheet contained January I would wish to
copy column c from the January sheet to column b of the summary sheet.
I really could do with some suggestions on how to achieve this.

Thanks in advance
Peter







  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Copy a column dependant on a the contents of a cell

Many thanks Biff, that helps me to understand what is going on and it makes
a bit more sense now.
Regards
Peter


"T. Valko" wrote in message
...
Most of the formula is taken up by testing for empty/blank cells:

=IF(A$1="","",IF(INDEX(INDIRECT(A$1&"!C:C"),ROWS($ 1:1))="","",

If A1 (cell holding month name) was empty that would cause the formula to
error. If the target cells on the target sheet are empty then the formula
would return 0's. I assumed you didn't want either of those situations to
occur.

INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:1)))

As you drag copy down, the ROWS($1:1) argument will increment like this:

INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:1))) = C1
INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:2))) = C2
INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:3))) = C3
INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:4))) = C4
etc
etc

Biff

"Peter" wrote in message
...
Thanks very much Biff, works a treat but I cannot follow why it works,
Many thanks
Peter
"T. Valko" wrote in message
...
One way:

=IF(A$1="","",IF(INDEX(INDIRECT(A$1&"!C:C"),ROWS($ 1:1))="","",INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:1)) ))

Copy down as needed.

Biff

"Peter" wrote in message
...
I wish to copy a column from one of several worksheets to a summary
sheet dependant upon the month.
EG. If cell A1 in the summary sheet contained January I would wish to
copy column c from the January sheet to column b of the summary sheet.
I really could do with some suggestions on how to achieve this.

Thanks in advance
Peter











  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Copy a column dependant on a the contents of a cell

You're welcome. Thanks for the feedback!

Biff

"Peter" wrote in message
...
Many thanks Biff, that helps me to understand what is going on and it
makes a bit more sense now.
Regards
Peter


"T. Valko" wrote in message
...
Most of the formula is taken up by testing for empty/blank cells:

=IF(A$1="","",IF(INDEX(INDIRECT(A$1&"!C:C"),ROWS($ 1:1))="","",

If A1 (cell holding month name) was empty that would cause the formula to
error. If the target cells on the target sheet are empty then the formula
would return 0's. I assumed you didn't want either of those situations to
occur.

INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:1)))

As you drag copy down, the ROWS($1:1) argument will increment like this:

INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:1))) = C1
INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:2))) = C2
INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:3))) = C3
INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:4))) = C4
etc
etc

Biff

"Peter" wrote in message
...
Thanks very much Biff, works a treat but I cannot follow why it works,
Many thanks
Peter
"T. Valko" wrote in message
...
One way:

=IF(A$1="","",IF(INDEX(INDIRECT(A$1&"!C:C"),ROWS($ 1:1))="","",INDEX(INDIRECT(A$1&"!C:C"),ROWS($1:1)) ))

Copy down as needed.

Biff

"Peter" wrote in message
...
I wish to copy a column from one of several worksheets to a summary
sheet dependant upon the month.
EG. If cell A1 in the summary sheet contained January I would wish to
copy column c from the January sheet to column b of the summary sheet.
I really could do with some suggestions on how to achieve this.

Thanks in advance
Peter











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
Sumproduct issues SteveDB1 Excel Worksheet Functions 25 June 3rd 09 04:58 PM
How do I combine spreadsheets and documents in one file? Trish Excel Discussion (Misc queries) 3 November 9th 06 09:17 PM
macro unouwanme Excel Discussion (Misc queries) 9 August 31st 06 09:38 PM
Conditional Format as a MACRO Gunjani Excel Worksheet Functions 3 March 29th 06 05:22 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM


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

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"