Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.worksheetfunctions
external usenet poster
 
Posts: 29
Default syntax correction

I wrote this function, the logics seem to ok, but there are too many logic,
as I the result I think I mess up the syntax. Can anyone correct for me?

the function is:
=IF(AND(F8<"X",F8=""),C3-D8,IF(F8<"",C3-F8)IF(AND(G8<"X",G8=""),C3-F8)*IF(G8<0,C3-G8)*IF(AND(H8<"X",H8=""),C3-G8,)IF(H8<"",C3-H8,0))

where C3 is a now() function with customed to time, and where D8 is the
beginning time for an employee. The function above time elapsed from the 1
break to 3 break. Each time a break is entered now() function or C3 has to
minus the time starting a break, then this equal to time elapsed since last
break..thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,574
Default syntax correction

Maybe:
=IF(AND(F8<"X",F8=""),C3-D8,IF(F8<"",C3-F8,IF(AND(G8<"X",G8=""),C3-F8),IF(G8<0,C3-G8),IF(AND(H8<"X",H8=""),C3-G8,IF(H8<"",C3-H8,0))))))

???

Creating helper columns rather than relying on one long formula may make
your logic clearer.

Dave

--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"Richard" wrote:

I wrote this function, the logics seem to ok, but there are too many logic,
as I the result I think I mess up the syntax. Can anyone correct for me?

the function is:
=IF(AND(F8<"X",F8=""),C3-D8,IF(F8<"",C3-F8)IF(AND(G8<"X",G8=""),C3-F8)*IF(G8<0,C3-G8)*IF(AND(H8<"X",H8=""),C3-G8,)IF(H8<"",C3-H8,0))

where C3 is a now() function with customed to time, and where D8 is the
beginning time for an employee. The function above time elapsed from the 1
break to 3 break. Each time a break is entered now() function or C3 has to
minus the time starting a break, then this equal to time elapsed since last
break..thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.newusers
external usenet poster
 
Posts: 6,953
Default syntax correction

the first part of your IF statement

=IF(AND(F8<"X",F8=""),C3-D8,IF(F8<"",C3-F8)

take the And(F8<"X",F8="") then only thing that satisfys that is if
F8="", so the F8<"X" is redundant

now that would give you

=IF(F8="",C3-D8,If(F8<"",C3-F8))

that pretty much boils down to
If(F8="",C3-D8,C3-F8)

Which boils down to

=C3-D8

Although you might have an operator missing between that and the next
statement, it isn't clear, so think you would be better of saying what is
entered in each of your cells and what rules you want to apply to arrive at
what.

--
Regards,
Tom Ogilvy



"Richard" wrote:

I wrote this function, the logics seem to ok, but there are too many logic,
as I the result I think I mess up the syntax. Can anyone correct for me?

the function is:
=IF(AND(F8<"X",F8=""),C3-D8,IF(F8<"",C3-F8)IF(AND(G8<"X",G8=""),C3-F8)*IF(G8<0,C3-G8)*IF(AND(H8<"X",H8=""),C3-G8,)IF(H8<"",C3-H8,0))

where C3 is a now() function with customed to time, and where D8 is the
beginning time for an employee. The function above time elapsed from the 1
break to 3 break. Each time a break is entered now() function or C3 has to
minus the time starting a break, then this equal to time elapsed since last
break..thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.newusers
external usenet poster
 
Posts: 9,101
Default syntax correction

there isn't 1 way to fix the formular. It is not clear what you are trying
to do.

There must be a commar before each IF. * are not allow to nest IF.

Instead you want someting like

if(A=B,if(C=D,if(E=F))) for nesting the IFs

"Richard" wrote:

I wrote this function, the logics seem to ok, but there are too many logic,
as I the result I think I mess up the syntax. Can anyone correct for me?

the function is:
=IF(AND(F8<"X",F8=""),C3-D8,IF(F8<"",C3-F8)IF(AND(G8<"X",G8=""),C3-F8)*IF(G8<0,C3-G8)*IF(AND(H8<"X",H8=""),C3-G8,)IF(H8<"",C3-H8,0))

where C3 is a now() function with customed to time, and where D8 is the
beginning time for an employee. The function above time elapsed from the 1
break to 3 break. Each time a break is entered now() function or C3 has to
minus the time starting a break, then this equal to time elapsed since last
break..thanks



  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.newusers
external usenet poster
 
Posts: 6,953
Default syntax correction

=if(S,if(A,B,C)*if(D,E,F),if(M,N,O)*if(P,Q,R))

would be legitimate, so I am not sure what you mean by * are not allowed.
But you are correct that the formula posted is not clear on what the OP
wants.

--
Regards,
Tom Ogilvy


"Joel" wrote:

there isn't 1 way to fix the formular. It is not clear what you are trying
to do.

There must be a commar before each IF. * are not allow to nest IF.

Instead you want someting like

if(A=B,if(C=D,if(E=F))) for nesting the IFs

"Richard" wrote:

I wrote this function, the logics seem to ok, but there are too many logic,
as I the result I think I mess up the syntax. Can anyone correct for me?

the function is:
=IF(AND(F8<"X",F8=""),C3-D8,IF(F8<"",C3-F8)IF(AND(G8<"X",G8=""),C3-F8)*IF(G8<0,C3-G8)*IF(AND(H8<"X",H8=""),C3-G8,)IF(H8<"",C3-H8,0))

where C3 is a now() function with customed to time, and where D8 is the
beginning time for an employee. The function above time elapsed from the 1
break to 3 break. Each time a break is entered now() function or C3 has to
minus the time starting a break, then this equal to time elapsed since last
break..thanks



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
Auto Correction david.salazar Excel Discussion (Misc queries) 1 July 19th 06 05:24 PM
correction nowfal Excel Discussion (Misc queries) 4 March 24th 06 06:40 PM
Error correction Lisleb Excel Discussion (Misc queries) 5 August 30th 05 04:48 PM
formula correction Roccobarocco Excel Worksheet Functions 4 December 6th 04 01:39 AM
decimal correction K.S.Warrier Excel Worksheet Functions 2 November 24th 04 09:25 AM


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