Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Extracting part of a spredsheet based on the date

I currently have a spreadsheet with all our employees down the A column
and then going across the top a calender. One column per day of the year
(it has to go over 2 spreadsheets). I then have a code that is input in
the grid to say what dates each employee is on holiday. I am looking
for a way to link another spreadsheet to this one, but only show the
columns relating to the current month and next month.

I can link in the first column with the employee's name as it is static,
but how do I get it to link only to this month and next month when it
changes each month?

I hope this makes sense.

Regards


Keith
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Extracting part of a spredsheet based on the date

put in formulas that involve a structure like this or similar

=offset(MasterSheet!$A$1,row(),match(Indirect(Addr ess(1,column())),masterShe
ets!$B$1:$IV$1,0),1,1)

since you have multiple sheets, it would be more complex in that you would
need to determine which sheet and which column in that sheet.

--
Regards,
Tom Ogilvy

"Keith" wrote in message
...
I currently have a spreadsheet with all our employees down the A column
and then going across the top a calender. One column per day of the year
(it has to go over 2 spreadsheets). I then have a code that is input in
the grid to say what dates each employee is on holiday. I am looking
for a way to link another spreadsheet to this one, but only show the
columns relating to the current month and next month.

I can link in the first column with the employee's name as it is static,
but how do I get it to link only to this month and next month when it
changes each month?

I hope this makes sense.

Regards


Keith



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Extracting part of a spredsheet based on the date

The number of columns can be calculated by Date(Year,Month,1)-Date(Year,1,1):
this gives you a number you can use with the OFFSET function to specify the
cell to link to in the master sheet: for example, this would be the formula
in B2
=OFFSET('[MasterBookName]MasterSheetName'!B2,0,Date(Year,Month,1)-Date(Year,1,1))
Substitute in the proper book and sheet names. You can copy this formula
throughout the output range and it should correctly link up the proper cells
from the master sheet into the corresponding cells in the new sheet. There
are just a couple things to take into account, though:
1) If any cells in the master sheet are blank, they will come across as
zeros; this may or may not be a problem and could be addressed either through
conditional formatting or adding an IF condition to the function above;
2) You would need to determine the proper # of columns to set up in the new
sheet; it would be nice to just have the same formula in 62 columns for 2
months and have it suppress the results if either of the two months was less
than 31 days; this would be possible with another IF condition (or maybe
CHOOSE) but you would end up with a very long formula and I don't know if you
need to do that. So I will leave that up to you to figure out!

HTH

"Keith" wrote:

I currently have a spreadsheet with all our employees down the A column
and then going across the top a calender. One column per day of the year
(it has to go over 2 spreadsheets). I then have a code that is input in
the grid to say what dates each employee is on holiday. I am looking
for a way to link another spreadsheet to this one, but only show the
columns relating to the current month and next month.

I can link in the first column with the employee's name as it is static,
but how do I get it to link only to this month and next month when it
changes each month?

I hope this makes sense.

Regards


Keith

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Extracting part of a spredsheet based on the date

That would certainly be more direct if weekends and actuall holidays are
included on the master sheet.

--
Regards,
Tom Ogilvy

"K Dales" wrote in message
...
The number of columns can be calculated by

Date(Year,Month,1)-Date(Year,1,1):
this gives you a number you can use with the OFFSET function to specify

the
cell to link to in the master sheet: for example, this would be the

formula
in B2:

=OFFSET('[MasterBookName]MasterSheetName'!B2,0,Date(Year,Month,1)-Date(Year,
1,1))
Substitute in the proper book and sheet names. You can copy this formula
throughout the output range and it should correctly link up the proper

cells
from the master sheet into the corresponding cells in the new sheet.

There
are just a couple things to take into account, though:
1) If any cells in the master sheet are blank, they will come across as
zeros; this may or may not be a problem and could be addressed either

through
conditional formatting or adding an IF condition to the function above;
2) You would need to determine the proper # of columns to set up in the

new
sheet; it would be nice to just have the same formula in 62 columns for 2
months and have it suppress the results if either of the two months was

less
than 31 days; this would be possible with another IF condition (or maybe
CHOOSE) but you would end up with a very long formula and I don't know if

you
need to do that. So I will leave that up to you to figure out!

HTH

"Keith" wrote:

I currently have a spreadsheet with all our employees down the A column
and then going across the top a calender. One column per day of the year
(it has to go over 2 spreadsheets). I then have a code that is input in
the grid to say what dates each employee is on holiday. I am looking
for a way to link another spreadsheet to this one, but only show the
columns relating to the current month and next month.

I can link in the first column with the employee's name as it is static,
but how do I get it to link only to this month and next month when it
changes each month?

I hope this makes sense.

Regards


Keith



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
Extracting part of a cell Colin Hayes Excel Worksheet Functions 2 August 5th 09 12:09 PM
Extracting part of data Himani Excel Discussion (Misc queries) 4 June 3rd 08 11:48 PM
Extracting part of a cell [email protected] Excel Worksheet Functions 6 May 22nd 08 01:11 AM
Extracting Part of a Date GLT Excel Discussion (Misc queries) 2 November 23rd 05 12:04 AM
extracting part of string value Dr. Schwartz[_3_] Excel Programming 3 April 23rd 04 01:23 PM


All times are GMT +1. The time now is 03:32 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"