Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Comparing a date with a range of dates

I have a table as follows

A B C D
Start Date End Date Employee Vacation Type

I then need to create a calendar to how each day in the month and who is
available and who has taken a leave and which type of leave.

So, I need to search the table for each day of the month to find if it is in
the list or not, and if it is, to put the type of leave for THAT person in
the calendar view.

The calendar looks like this...

Date 1/1 1/2 1/3 1/4
Emp1
Emp2
Emp3
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Comparing a date with a range of dates

Try this...

The raw data table in the range A1:D5.

Calendar in the range A12:E15

Enter this array formula** in B13:

=INDEX($D$2:$D$5,MATCH(1,($C$2:$C$5=$A13)*($A$2:$A $5<=B$12)*($B$2:$B$5=B$12),0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

Copy across to E13 then down to B15:E15.

When the criteria are not met the formula will return #N/A. You can either
include an error trap in the formula to account for these which will make
the formula about twice as long or you can use conditional formatting to
"hide" the #N/A. I would recommend using CF to "hide" them. They'll still be
there, you just won't see them. Or, you can just leave them. Post back and
advise on how you'd like to handle that.

--
Biff
Microsoft Excel MVP


"Hany ElKady" wrote in message
...
I have a table as follows

A B C D
Start Date End Date Employee Vacation Type

I then need to create a calendar to how each day in the month and who is
available and who has taken a leave and which type of leave.

So, I need to search the table for each day of the month to find if it is
in
the list or not, and if it is, to put the type of leave for THAT person in
the calendar view.

The calendar looks like this...

Date 1/1 1/2 1/3 1/4
Emp1
Emp2
Emp3



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Comparing a date with a range of dates

Hi Biff,

Thanks I seem to had been going around in circules with a lot of IF
statements, this is much easier. Just one last thing, the CF, I can't seem to
be able to hide the error #N/A, is there a way to tell it to HIDE the
content, because I had formatted this table using the standard table
formating in excel, and each row is a different color, plus I already have
conditional formatting to show weekends and holidays.

Thanks
Hany
--
Hany ElKady
Professional Services Architect
Technology & Service Delivery


"T. Valko" wrote:

Try this...

The raw data table in the range A1:D5.

Calendar in the range A12:E15

Enter this array formula** in B13:

=INDEX($D$2:$D$5,MATCH(1,($C$2:$C$5=$A13)*($A$2:$A $5<=B$12)*($B$2:$B$5=B$12),0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

Copy across to E13 then down to B15:E15.

When the criteria are not met the formula will return #N/A. You can either
include an error trap in the formula to account for these which will make
the formula about twice as long or you can use conditional formatting to
"hide" the #N/A. I would recommend using CF to "hide" them. They'll still be
there, you just won't see them. Or, you can just leave them. Post back and
advise on how you'd like to handle that.

--
Biff
Microsoft Excel MVP


"Hany ElKady" wrote in message
...
I have a table as follows

A B C D
Start Date End Date Employee Vacation Type

I then need to create a calendar to how each day in the month and who is
available and who has taken a leave and which type of leave.

So, I need to search the table for each day of the month to find if it is
in
the list or not, and if it is, to put the type of leave for THAT person in
the calendar view.

The calendar looks like this...

Date 1/1 1/2 1/3 1/4
Emp1
Emp2
Emp3




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Comparing a date with a range of dates

Well, if you can add a condition to the CF or incorporate this into an
existing condition, what you want to do is test the cell for an error and
set the text color to be the same as the background color thus making the
text (or the #N/A error) unseen.

=ISERROR(A1)

If you can't do that then you'll need to use an error trap in the formula:

=IF(ISNA(MATCH(1,($C$2:$C$5=$A13)*($A$2:$A$5<=B$12 )*($B$2:$B$5=B$12),0)),"",INDEX($D$2:$D$5,MATCH(1 ,($C$2:$C$5=$A13)*($A$2:$A$5<=B$12)*($B$2:$B$5=B$ 12),0)))


--
Biff
Microsoft Excel MVP


"Hany ElKady" wrote in message
...
Hi Biff,

Thanks I seem to had been going around in circules with a lot of IF
statements, this is much easier. Just one last thing, the CF, I can't seem
to
be able to hide the error #N/A, is there a way to tell it to HIDE the
content, because I had formatted this table using the standard table
formating in excel, and each row is a different color, plus I already have
conditional formatting to show weekends and holidays.

Thanks
Hany
--
Hany ElKady
Professional Services Architect
Technology & Service Delivery


"T. Valko" wrote:

Try this...

The raw data table in the range A1:D5.

Calendar in the range A12:E15

Enter this array formula** in B13:

=INDEX($D$2:$D$5,MATCH(1,($C$2:$C$5=$A13)*($A$2:$A $5<=B$12)*($B$2:$B$5=B$12),0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
SHIFT
key then hit ENTER.

Copy across to E13 then down to B15:E15.

When the criteria are not met the formula will return #N/A. You can
either
include an error trap in the formula to account for these which will make
the formula about twice as long or you can use conditional formatting to
"hide" the #N/A. I would recommend using CF to "hide" them. They'll still
be
there, you just won't see them. Or, you can just leave them. Post back
and
advise on how you'd like to handle that.

--
Biff
Microsoft Excel MVP


"Hany ElKady" wrote in message
...
I have a table as follows

A B C D
Start Date End Date Employee Vacation Type

I then need to create a calendar to how each day in the month and who
is
available and who has taken a leave and which type of leave.

So, I need to search the table for each day of the month to find if it
is
in
the list or not, and if it is, to put the type of leave for THAT person
in
the calendar view.

The calendar looks like this...

Date 1/1 1/2 1/3 1/4
Emp1
Emp2
Emp3






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Comparing a date with a range of dates

Hi Biff, thanks for all your help.

I tried your formula, and then did a bit of tweaking myself... I actually
got a much shoter formula by using iferror instead of isna :)

Tanks
--
Hany ElKady
IT Consultant

"T. Valko" wrote:

Well, if you can add a condition to the CF or incorporate this into an
existing condition, what you want to do is test the cell for an error and
set the text color to be the same as the background color thus making the
text (or the #N/A error) unseen.

=ISERROR(A1)

If you can't do that then you'll need to use an error trap in the formula:

=IF(ISNA(MATCH(1,($C$2:$C$5=$A13)*($A$2:$A$5<=B$12 )*($B$2:$B$5=B$12),0)),"",INDEX($D$2:$D$5,MATCH(1 ,($C$2:$C$5=$A13)*($A$2:$A$5<=B$12)*($B$2:$B$5=B$ 12),0)))


--
Biff
Microsoft Excel MVP


"Hany ElKady" wrote in message
...
Hi Biff,

Thanks I seem to had been going around in circules with a lot of IF
statements, this is much easier. Just one last thing, the CF, I can't seem
to
be able to hide the error #N/A, is there a way to tell it to HIDE the
content, because I had formatted this table using the standard table
formating in excel, and each row is a different color, plus I already have
conditional formatting to show weekends and holidays.

Thanks
Hany
--
Hany ElKady
Professional Services Architect
Technology & Service Delivery


"T. Valko" wrote:

Try this...

The raw data table in the range A1:D5.

Calendar in the range A12:E15

Enter this array formula** in B13:

=INDEX($D$2:$D$5,MATCH(1,($C$2:$C$5=$A13)*($A$2:$A $5<=B$12)*($B$2:$B$5=B$12),0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
SHIFT
key then hit ENTER.

Copy across to E13 then down to B15:E15.

When the criteria are not met the formula will return #N/A. You can
either
include an error trap in the formula to account for these which will make
the formula about twice as long or you can use conditional formatting to
"hide" the #N/A. I would recommend using CF to "hide" them. They'll still
be
there, you just won't see them. Or, you can just leave them. Post back
and
advise on how you'd like to handle that.

--
Biff
Microsoft Excel MVP


"Hany ElKady" wrote in message
...
I have a table as follows

A B C D
Start Date End Date Employee Vacation Type

I then need to create a calendar to how each day in the month and who
is
available and who has taken a leave and which type of leave.

So, I need to search the table for each day of the month to find if it
is
in
the list or not, and if it is, to put the type of leave for THAT person
in
the calendar view.

The calendar looks like this...

Date 1/1 1/2 1/3 1/4
Emp1
Emp2
Emp3








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Comparing a date with a range of dates

using iferror instead of isna :)

Yeah, one of the advantages of using Excel 2007.

Thanks for the feedback!


--
Biff
Microsoft Excel MVP


"Hany ElKady" wrote in message
...
Hi Biff, thanks for all your help.

I tried your formula, and then did a bit of tweaking myself... I actually
got a much shoter formula by using iferror instead of isna :)

Tanks
--
Hany ElKady
IT Consultant

"T. Valko" wrote:

Well, if you can add a condition to the CF or incorporate this into an
existing condition, what you want to do is test the cell for an error and
set the text color to be the same as the background color thus making the
text (or the #N/A error) unseen.

=ISERROR(A1)

If you can't do that then you'll need to use an error trap in the
formula:

=IF(ISNA(MATCH(1,($C$2:$C$5=$A13)*($A$2:$A$5<=B$12 )*($B$2:$B$5=B$12),0)),"",INDEX($D$2:$D$5,MATCH(1 ,($C$2:$C$5=$A13)*($A$2:$A$5<=B$12)*($B$2:$B$5=B$ 12),0)))


--
Biff
Microsoft Excel MVP


"Hany ElKady" wrote in message
...
Hi Biff,

Thanks I seem to had been going around in circules with a lot of IF
statements, this is much easier. Just one last thing, the CF, I can't
seem
to
be able to hide the error #N/A, is there a way to tell it to HIDE the
content, because I had formatted this table using the standard table
formating in excel, and each row is a different color, plus I already
have
conditional formatting to show weekends and holidays.

Thanks
Hany
--
Hany ElKady
Professional Services Architect
Technology & Service Delivery


"T. Valko" wrote:

Try this...

The raw data table in the range A1:D5.

Calendar in the range A12:E15

Enter this array formula** in B13:

=INDEX($D$2:$D$5,MATCH(1,($C$2:$C$5=$A13)*($A$2:$A $5<=B$12)*($B$2:$B$5=B$12),0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
SHIFT
key then hit ENTER.

Copy across to E13 then down to B15:E15.

When the criteria are not met the formula will return #N/A. You can
either
include an error trap in the formula to account for these which will
make
the formula about twice as long or you can use conditional formatting
to
"hide" the #N/A. I would recommend using CF to "hide" them. They'll
still
be
there, you just won't see them. Or, you can just leave them. Post back
and
advise on how you'd like to handle that.

--
Biff
Microsoft Excel MVP


"Hany ElKady" wrote in message
...
I have a table as follows

A B C D
Start Date End Date Employee Vacation Type

I then need to create a calendar to how each day in the month and
who
is
available and who has taken a leave and which type of leave.

So, I need to search the table for each day of the month to find if
it
is
in
the list or not, and if it is, to put the type of leave for THAT
person
in
the calendar view.

The calendar looks like this...

Date 1/1 1/2 1/3 1/4
Emp1
Emp2
Emp3








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
Sum If range of dates date range, sum totals Stilmovin Excel Worksheet Functions 7 December 16th 08 05:49 PM
selecting the first date in a range of dates shoun2me Excel Worksheet Functions 7 August 8th 07 07:02 PM
return a date from range, date is between dates in two other cells NN Excel Discussion (Misc queries) 1 September 28th 06 10:05 PM
How to get individual dates from a date range MorningCalm Excel Discussion (Misc queries) 3 September 6th 06 05:45 PM
How to count dates within a certain range in a column with mutiple date range entries Krisjhn Excel Worksheet Functions 2 September 1st 05 01:59 PM


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