#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default IF function

I'm trying to use the If function for a schedule.

If cell F5 = 11a-7p, then 7.5, if F5=6a-1:30p, then 7,If 6:30a-1:30p, then
6.5.

I keep getting the INVALID error.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default IF function

On Tue, 4 Dec 2007 18:30:01 -0800, Sunshine wrote:

I'm trying to use the If function for a schedule.

If cell F5 = 11a-7p, then 7.5, if F5=6a-1:30p, then 7,If 6:30a-1:30p, then
6.5.

I keep getting the INVALID error.


First, you will have to give some different order to your overlapping
conditions.
If they are in order you wrote, then you will never get 6.5 as a result
(because the middle condition includes all of the later).
Same thing with time between 11am and 13:30pm - first condition takes it
first.

Besides that, the correct formula would be (in one row, of course):
=IF(AND(F5=TIME(11,0,0),F5<=TIME(19,0,0)),7.5,IF( AND(F5=TIME(6,0,0),F5<=TIME(13,30,0)),7,IF(AND(F5 =TIME(6,30,0),F5<=TIME(13,30,0)),6.5,0)))

If you look at it differently, this is the logic of it:

=IF(AND(F5=TIME(11,0,0),F5<=TIME(19,0,0)),
7.5,
IF(AND(F5=TIME(6,0,0),F5<=TIME(13,30,0)),
7,
IF(AND(F5=TIME(6,30,0),F5<=TIME(13,30,0)),
6.5,
0)
)
)

hth
B.
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
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Nested IF Function, Date Comparing, and NetworkDays Function carl Excel Worksheet Functions 2 December 29th 04 09:57 PM


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