#1   Report Post  
Posted to microsoft.public.excel.misc
superkopite
 
Posts: n/a
Default shade cells


Hey guys and gals

this should be a simple problem i just cannot work it out!

In A2 i have a Name i.e James
In B2 i have a start time i.e 07:30
In C2 i have a finish time i.e 16:00
In E1 to AN1 i have times ranging from 06:00 to 23:30

What i need is the following:
The cells in E2 to AN1 to be shaded from the B2 start time to the C2
finish time

like i say this doesn't sound to difficult and and i am sure there is a
very easy way to do it but i just can work it out

cheers

James


--
superkopite
------------------------------------------------------------------------
superkopite's Profile: http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=503689

  #2   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default shade cells


Select E1:N1 with E1 active cell

Format Conditional Formatting formula is

=(E1=$B2)*(E1<=$C2)

Apply desired formatting


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=503689

  #3   Report Post  
Posted to microsoft.public.excel.misc
superkopite
 
Posts: n/a
Default shade cells


you truly are the Daddy

Thanks a lot!!


--
superkopite
------------------------------------------------------------------------
superkopite's Profile: http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=503689

  #4   Report Post  
Posted to microsoft.public.excel.misc
Bill Kuunders
 
Posts: n/a
Default shade cells

Assuming that you want to color the cells between E2 and AN2 and not
AN1.........

Copy the times down from E1 :AN1 to E2:AN2
select the cells E2:AN2
go to format
conditional formatting
use cell value is between B2 and C2
select format...
pattern

if you do not want to show the times in that row you need to
use the normal format......... cells........font to select the font to be
white for all cells
and select the font as well as the pattern to be grey in the conditional
format.

--
Greetings from New Zealand
Bill K



"superkopite"
wrote in message
...

Hey guys and gals

this should be a simple problem i just cannot work it out!

In A2 i have a Name i.e James
In B2 i have a start time i.e 07:30
In C2 i have a finish time i.e 16:00
In E1 to AN1 i have times ranging from 06:00 to 23:30

What i need is the following:
The cells in E2 to AN1 to be shaded from the B2 start time to the C2
finish time

like i say this doesn't sound to difficult and and i am sure there is a
very easy way to do it but i just can work it out

cheers

James


--
superkopite
------------------------------------------------------------------------
superkopite's Profile:
http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=503689



  #5   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default shade cells

Select E2:AN2, and then use Conditional Formatting with a formula of

=AND($B2<=E$1,$C2=E$1)

CF:
FormatConditional formatting
Change Condition 1 to Formula Is
Add the formula
Select Format
Patterns tab
Pick a colour
OK

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"superkopite"
wrote in message
...

Hey guys and gals

this should be a simple problem i just cannot work it out!

In A2 i have a Name i.e James
In B2 i have a start time i.e 07:30
In C2 i have a finish time i.e 16:00
In E1 to AN1 i have times ranging from 06:00 to 23:30

What i need is the following:
The cells in E2 to AN1 to be shaded from the B2 start time to the C2
finish time

like i say this doesn't sound to difficult and and i am sure there is a
very easy way to do it but i just can work it out

cheers

James


--
superkopite
------------------------------------------------------------------------
superkopite's Profile:

http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=503689





  #6   Report Post  
Posted to microsoft.public.excel.misc
superkopite
 
Posts: n/a
Default shade cells


Thanks for all the responses guys once again i am spoilt for choice.

This is most definatley the best forum ever!


Thanks Daddylonglegs

=(E1=$B2)*(E1<=$C2) works great

but why does this not work;
=($E$1=$B2)*($E$1<=$C2)

Cheers

James


--
superkopite
------------------------------------------------------------------------
superkopite's Profile: http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=503689

  #7   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default shade cells


superkopite Wrote:

=(E1=$B2)*(E1<=$C2) works great

but why does this not work;
=($E$1=$B2)*($E$1<=$C2)


The first one adjusts for each cell so if you look at CF in F1 it
should say

=(F1=$B2)*(F1<=$C2)

but because of the $s around E1 the second remains the same in all
cells, so your whole range E1:N1 will be formatted the same according
to whether E1 is formatted


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=503689

  #8   Report Post  
Posted to microsoft.public.excel.misc
superkopite
 
Posts: n/a
Default shade cells


that is what it needs to be as E1 to AO1 is where the time referance is
obtained from.

so even row 4, the formula reads =(E1=$B4)*(E1<=$C4) and that works
but when i drag down obviously the E1 changes to F1

Or have i missed something here?

Cheers

James


--
superkopite
------------------------------------------------------------------------
superkopite's Profile: http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=503689

  #9   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default shade cells


Now I'm a little confused - you wanted to format E1:AO1 depending on
times in B2 and C2.

Do you want to extend this to other rows?


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=503689

  #10   Report Post  
Posted to microsoft.public.excel.misc
superkopite
 
Posts: n/a
Default shade cells


sorry to be a pain

yeah i wanted it to extend to other rows

so in row A4

=(E1=$B4)*(E1<=$C4) works fine but,
=($E$1=$B4)*($E$1<=$C4) does not

with my limted knowledge these two formulas are the same until you drag
them are they not?


--
superkopite
------------------------------------------------------------------------
superkopite's Profile: http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=503689



  #11   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default shade cells


I tried to explain in my earlier post but I may have just confused
things

If you apply this CF formula....

=(E1=$B2)*(E1<=$C2)

..... to a range, e.g. E1:AO1 it automatically adjusts across the
columns. so in G1 this becomes

=(G1=$B2)(G1=$C2) which is what you need to happen

(note that $B2 doesn't change because the $ fixes the column
reference)

You can't use

=($E$1=$B4)*($E$1<=$C4) because although it should work correctly in
E1 it won't work in F1:AO1

perhaps you want

=(E$1=$B4)*(E$1<=$C4)

this fixes the row reference but not the column reference


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=503689

  #12   Report Post  
Posted to microsoft.public.excel.misc
superkopite
 
Posts: n/a
Default shade cells


How could i make such a basic error by putting the $ in front of both E
and 1!!!

I thought iwas getting better at this!!!

Thank you very much mate

James


--
superkopite
------------------------------------------------------------------------
superkopite's Profile: http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=503689

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
Is there an Excel function to shade cells? Tommy Excel Worksheet Functions 2 October 29th 05 03:37 AM
how do i protect cells in a shared worksheet Debi Excel Discussion (Misc queries) 3 September 30th 05 11:15 PM
requires that merged cells must be identically sized? Catt Excel Discussion (Misc queries) 11 July 3rd 05 12:36 PM
Fill cells from non-adjacent cells Abes Excel Discussion (Misc queries) 2 March 25th 05 01:15 PM
Convert data type of cells to Text,Number,Date and Time Kevin Excel Worksheet Functions 1 December 31st 04 12:57 PM


All times are GMT +1. The time now is 03:05 PM.

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"