Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default Add a formula to and existing formula

Hi
I have the following formula =AND($A$6="w",$F$6TIME(7,0,0))+$F$6
which is great. If the letter W is added into cell A6 and the time is
greater than 7 hours in cell F6, F6 will be shaded in red. If no W is added
in A6 this rule does not apply.
Now what I want to do is still using the same cells and still having the
rule above active add more to it. For example if the letter P is added
instead of a W and a time is greater than 10 hours then the cell will change
to blue. I have tried to add =AND($A$6="p",$F$6TIME(10,0,0))+$F$6 to the one
above but keep getting an error message.

Please help.




  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Add a formula to and existing formula

I wonder if I understand your question correctly.

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6

I don't understand. How can $F$6 ever be greater than 7 hrs + $F$6? (I
didn't think that you can have a negative time so it would always be greater
unless $F$6 is zero)
I would think that the formula should be:-
=AND($A$6="w",$F$6TIME(7,0,0)) if you are testing $F$6 for greater than
7hrs in which case you simply add a second condition with the new formula to
the conditional formatting.
To add a second condition in pre xl2007, click the Add button.
In xl2007, click New rule but note that the new rule inserts at the top and
you use the arrows out to the right to move the rule to the required position.


--
Regards,

OssieMac


"Marty" wrote:

Hi
I have the following formula =AND($A$6="w",$F$6TIME(7,0,0))+$F$6
which is great. If the letter W is added into cell A6 and the time is
greater than 7 hours in cell F6, F6 will be shaded in red. If no W is added
in A6 this rule does not apply.
Now what I want to do is still using the same cells and still having the
rule above active add more to it. For example if the letter P is added
instead of a W and a time is greater than 10 hours then the cell will change
to blue. I have tried to add =AND($A$6="p",$F$6TIME(10,0,0))+$F$6 to the one
above but keep getting an error message.

Please help.




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Add a formula to and existing formula

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6
=AND($A$6="p",$F$6TIME(10,0,0))+$F$6


Is there a specific reason why you're adding F6 to the end of the formula?

The result of the AND function will be either TRUE or FALSE and those
logicals will convert to 1 or 0 when added to F6. If F6 was 3:00 PM the
result of the AND function would be FALSE yet the format would still be
applied because F6 contains a number and any number other than 0 evaluates
as TRUE in logical terms.

What you need to do is add a second condition to the conditional formatting.

Use as the first condition (determine if you really need that +$F$6):

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6

Use as the second condition (determine if you really need that +$F$6):

=AND($A$6="p",$F$6TIME(10,0,0))+$F$6


--
Biff
Microsoft Excel MVP


"Marty" wrote in message
...
Hi
I have the following formula =AND($A$6="w",$F$6TIME(7,0,0))+$F$6
which is great. If the letter W is added into cell A6 and the time is
greater than 7 hours in cell F6, F6 will be shaded in red. If no W is
added
in A6 this rule does not apply.
Now what I want to do is still using the same cells and still having the
rule above active add more to it. For example if the letter P is added
instead of a W and a time is greater than 10 hours then the cell will
change
to blue. I have tried to add =AND($A$6="p",$F$6TIME(10,0,0))+$F$6 to the
one
above but keep getting an error message.

Please help.






  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default Add a formula to and existing formula

Thank you I will give it a go.

Some more info:
A6 is either to be W or P only.
B6 is blank
C6 is strart date and time
D6 is end date and time
E6 blank
F6 is D6-C6 with the conditional format applied. Therefore if W is entered
in A6 the difference in F6 should be highlighted in red if more than 7 hours
difference. Now if P was added in A6 then cell F6 should be highlighted blue
if the difference is more than 10 hours.
Clear as mud?


"T. Valko" wrote:

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6
=AND($A$6="p",$F$6TIME(10,0,0))+$F$6


Is there a specific reason why you're adding F6 to the end of the formula?

The result of the AND function will be either TRUE or FALSE and those
logicals will convert to 1 or 0 when added to F6. If F6 was 3:00 PM the
result of the AND function would be FALSE yet the format would still be
applied because F6 contains a number and any number other than 0 evaluates
as TRUE in logical terms.

What you need to do is add a second condition to the conditional formatting.

Use as the first condition (determine if you really need that +$F$6):

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6

Use as the second condition (determine if you really need that +$F$6):

=AND($A$6="p",$F$6TIME(10,0,0))+$F$6


--
Biff
Microsoft Excel MVP


"Marty" wrote in message
...
Hi
I have the following formula =AND($A$6="w",$F$6TIME(7,0,0))+$F$6
which is great. If the letter W is added into cell A6 and the time is
greater than 7 hours in cell F6, F6 will be shaded in red. If no W is
added
in A6 this rule does not apply.
Now what I want to do is still using the same cells and still having the
rule above active add more to it. For example if the letter P is added
instead of a W and a time is greater than 10 hours then the cell will
change
to blue. I have tried to add =AND($A$6="p",$F$6TIME(10,0,0))+$F$6 to the
one
above but keep getting an error message.

Please help.







  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default Add a formula to and existing formula

T.Valko, thanks for the advise, but your suggestion did not work:(

Anyone else help????

"Marty" wrote:

Thank you I will give it a go.

Some more info:
A6 is either to be W or P only.
B6 is blank
C6 is strart date and time
D6 is end date and time
E6 blank
F6 is D6-C6 with the conditional format applied. Therefore if W is entered
in A6 the difference in F6 should be highlighted in red if more than 7 hours
difference. Now if P was added in A6 then cell F6 should be highlighted blue
if the difference is more than 10 hours.
Clear as mud?


"=AND($A$6="w",$F$6TIME(7,0,0))+$F$6+AND($A$6="p" ,$F$6TIME(10,0,0))+$F$6" wrote:

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6
=AND($A$6="p",$F$6TIME(10,0,0))+$F$6


Is there a specific reason why you're adding F6 to the end of the formula?

The result of the AND function will be either TRUE or FALSE and those
logicals will convert to 1 or 0 when added to F6. If F6 was 3:00 PM the
result of the AND function would be FALSE yet the format would still be
applied because F6 contains a number and any number other than 0 evaluates
as TRUE in logical terms.

What you need to do is add a second condition to the conditional formatting.

Use as the first condition (determine if you really need that +$F$6):

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6

Use as the second condition (determine if you really need that +$F$6):

=AND($A$6="p",$F$6TIME(10,0,0))+$F$6


--
Biff
Microsoft Excel MVP


"Marty" wrote in message
...
Hi
I have the following formula =AND($A$6="w",$F$6TIME(7,0,0))+$F$6
which is great. If the letter W is added into cell A6 and the time is
greater than 7 hours in cell F6, F6 will be shaded in red. If no W is
added
in A6 this rule does not apply.
Now what I want to do is still using the same cells and still having the
rule above active add more to it. For example if the letter P is added
instead of a W and a time is greater than 10 hours then the cell will
change
to blue. I have tried to add =AND($A$6="p",$F$6TIME(10,0,0))+$F$6 to the
one
above but keep getting an error message.

Please help.









  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Add a formula to and existing formula

Use this formula for condition 1 (blue):

=AND(A6="P",ROUND((D6-C6)*24,0)10)

Use this formula for condition 2 (red):

=AND(A6="W",ROUND((D6-C6)*24,0)7)

--
Biff
Microsoft Excel MVP


"Marty" wrote in message
...
Thank you I will give it a go.

Some more info:
A6 is either to be W or P only.
B6 is blank
C6 is strart date and time
D6 is end date and time
E6 blank
F6 is D6-C6 with the conditional format applied. Therefore if W is entered
in A6 the difference in F6 should be highlighted in red if more than 7
hours
difference. Now if P was added in A6 then cell F6 should be highlighted
blue
if the difference is more than 10 hours.
Clear as mud?


"T. Valko" wrote:

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6
=AND($A$6="p",$F$6TIME(10,0,0))+$F$6


Is there a specific reason why you're adding F6 to the end of the
formula?

The result of the AND function will be either TRUE or FALSE and those
logicals will convert to 1 or 0 when added to F6. If F6 was 3:00 PM the
result of the AND function would be FALSE yet the format would still be
applied because F6 contains a number and any number other than 0
evaluates
as TRUE in logical terms.

What you need to do is add a second condition to the conditional
formatting.

Use as the first condition (determine if you really need that +$F$6):

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6

Use as the second condition (determine if you really need that +$F$6):

=AND($A$6="p",$F$6TIME(10,0,0))+$F$6


--
Biff
Microsoft Excel MVP


"Marty" wrote in message
...
Hi
I have the following formula =AND($A$6="w",$F$6TIME(7,0,0))+$F$6
which is great. If the letter W is added into cell A6 and the time is
greater than 7 hours in cell F6, F6 will be shaded in red. If no W is
added
in A6 this rule does not apply.
Now what I want to do is still using the same cells and still having
the
rule above active add more to it. For example if the letter P is added
instead of a W and a time is greater than 10 hours then the cell will
change
to blue. I have tried to add =AND($A$6="p",$F$6TIME(10,0,0))+$F$6 to
the
one
above but keep getting an error message.

Please help.









  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default Add a formula to and existing formula

Oh, so close:

W=Red,
for some reason the cell changes red at a difference of 7 hours 30 minutes
in cell F6

P=Blue,
for some reason the cell changes blue at a difference of 10 hours 30
minutes in cell F6

Thanks for the great advise so far.

"T. Valko" wrote:

Use this formula for condition 1 (blue):

=AND(A6="P",ROUND((D6-C6)*24,0)10)

Use this formula for condition 2 (red):

=AND(A6="W",ROUND((D6-C6)*24,0)7)

--
Biff
Microsoft Excel MVP


"Marty" wrote in message
...
Thank you I will give it a go.

Some more info:
A6 is either to be W or P only.
B6 is blank
C6 is strart date and time
D6 is end date and time
E6 blank
F6 is D6-C6 with the conditional format applied. Therefore if W is entered
in A6 the difference in F6 should be highlighted in red if more than 7
hours
difference. Now if P was added in A6 then cell F6 should be highlighted
blue
if the difference is more than 10 hours.
Clear as mud?


"T. Valko" wrote:

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6
=AND($A$6="p",$F$6TIME(10,0,0))+$F$6

Is there a specific reason why you're adding F6 to the end of the
formula?

The result of the AND function will be either TRUE or FALSE and those
logicals will convert to 1 or 0 when added to F6. If F6 was 3:00 PM the
result of the AND function would be FALSE yet the format would still be
applied because F6 contains a number and any number other than 0
evaluates
as TRUE in logical terms.

What you need to do is add a second condition to the conditional
formatting.

Use as the first condition (determine if you really need that +$F$6):

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6

Use as the second condition (determine if you really need that +$F$6):

=AND($A$6="p",$F$6TIME(10,0,0))+$F$6


--
Biff
Microsoft Excel MVP


"Marty" wrote in message
...
Hi
I have the following formula =AND($A$6="w",$F$6TIME(7,0,0))+$F$6
which is great. If the letter W is added into cell A6 and the time is
greater than 7 hours in cell F6, F6 will be shaded in red. If no W is
added
in A6 this rule does not apply.
Now what I want to do is still using the same cells and still having
the
rule above active add more to it. For example if the letter P is added
instead of a W and a time is greater than 10 hours then the cell will
change
to blue. I have tried to add =AND($A$6="p",$F$6TIME(10,0,0))+$F$6 to
the
one
above but keep getting an error message.

Please help.










  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Add a formula to and existing formula

Isn't that what you wanted?

F6 should be highlighted in red if more than 7 hours


F6 should be highlighted blue if the difference is
more than 10 hours.



--
Biff
Microsoft Excel MVP


"Marty" wrote in message
...
Oh, so close:

W=Red,
for some reason the cell changes red at a difference of 7 hours 30
minutes
in cell F6

P=Blue,
for some reason the cell changes blue at a difference of 10 hours 30
minutes in cell F6

Thanks for the great advise so far.

"T. Valko" wrote:

Use this formula for condition 1 (blue):

=AND(A6="P",ROUND((D6-C6)*24,0)10)

Use this formula for condition 2 (red):

=AND(A6="W",ROUND((D6-C6)*24,0)7)

--
Biff
Microsoft Excel MVP


"Marty" wrote in message
...
Thank you I will give it a go.

Some more info:
A6 is either to be W or P only.
B6 is blank
C6 is strart date and time
D6 is end date and time
E6 blank
F6 is D6-C6 with the conditional format applied. Therefore if W is
entered
in A6 the difference in F6 should be highlighted in red if more than 7
hours
difference. Now if P was added in A6 then cell F6 should be highlighted
blue
if the difference is more than 10 hours.
Clear as mud?


"T. Valko" wrote:

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6
=AND($A$6="p",$F$6TIME(10,0,0))+$F$6

Is there a specific reason why you're adding F6 to the end of the
formula?

The result of the AND function will be either TRUE or FALSE and those
logicals will convert to 1 or 0 when added to F6. If F6 was 3:00 PM
the
result of the AND function would be FALSE yet the format would still
be
applied because F6 contains a number and any number other than 0
evaluates
as TRUE in logical terms.

What you need to do is add a second condition to the conditional
formatting.

Use as the first condition (determine if you really need that +$F$6):

=AND($A$6="w",$F$6TIME(7,0,0))+$F$6

Use as the second condition (determine if you really need that +$F$6):

=AND($A$6="p",$F$6TIME(10,0,0))+$F$6


--
Biff
Microsoft Excel MVP


"Marty" wrote in message
...
Hi
I have the following formula =AND($A$6="w",$F$6TIME(7,0,0))+$F$6
which is great. If the letter W is added into cell A6 and the time
is
greater than 7 hours in cell F6, F6 will be shaded in red. If no W
is
added
in A6 this rule does not apply.
Now what I want to do is still using the same cells and still having
the
rule above active add more to it. For example if the letter P is
added
instead of a W and a time is greater than 10 hours then the cell
will
change
to blue. I have tried to add =AND($A$6="p",$F$6TIME(10,0,0))+$F$6
to
the
one
above but keep getting an error message.

Please help.












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
Adding to an existing formula JPS Excel Worksheet Functions 2 April 17th 08 04:04 PM
Editing an existing formula Jen Excel Worksheet Functions 1 October 24th 05 07:55 PM
insert a new cell into an existing formula Debbie Excel Discussion (Misc queries) 3 March 14th 05 06:46 PM
Modifying an Existing Formula carl Excel Worksheet Functions 1 December 31st 04 04:55 PM
Need help to expand existing formula Connie Martin Excel Worksheet Functions 4 November 26th 04 04:23 PM


All times are GMT +1. The time now is 02:37 AM.

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"