If formula with calculations

1. If formula with calculations

Hi Everyone,

I hope you all are well.

Am trying hard with an IF formulas trying to calculate hours of overtime for driver project.

This is the formula
1.jpg
(I tried to attach the file, but something it's wrong with the attachment option)

So the formula is: =IF(C4="Monday",(J1-D4)+(E4-K1),"") and it is calculating correct.

But when I want to add other conditions inside the formula the problems show up.
=IF(C4="Monday",(J1-D4)+(E4-K1),""),IF(C4="Saturday",(J2-D4)+(E4-K2),"")) : You've entered too many arguments for this functions.

Why does this happen? And how can I overcome this problem?

I am trying to calculate the regular hrs with to hrs based on the weekdays and holidays.

Kindly, I will appreciate a lot your help.
Regards,

2. Re: If formula with calculations

This formula is basically incorrect.
This the first complete IF
IF(C4="Monday",(J1-D4)+(E4-K1),"")
After a comma, you have another
IF(C4="Saturday",(J2-D4)+(E4-K2),"")
And you finish everything with a right bracket ) without its left counterpart ( what is wrong itself, no matter what is the rest of the formula.

What do you really want to calculate? The time for Monday plus time for Saturday or something else?

3. Re: If formula with calculations

Sorry, PKowalik you are correct. I forgot to remove the bracket.

=IF(C4="Monday",J1-D4+E4-K1,"", IF(C4="Saturday",J2-D4+E4-K2,"")) (Result : You've entered too many arguments for this functions.)

I want to calculate the overtime based on weekdays, Saturday, Sundays, and Holidays.

For Example;

On Weekdays (Monday up to Friday) the Morning Regular time start from 07:30 AM and in the Evening the Regular time end on 17:00 PM
So let say that the driver starts the work on 06:00 AM and his end reporting time is 18:00 PM
Now we have 1 hr of OT in the morning and 1 hr of OT in the evening. (1+1= 2 hr of OT)

IF A="Monday" then (morning reporting time - fixed time) + (fixed time - evening time)
This must give us a total of overtime done by the Driver.
If I use only this formula is correct. But when I want to add more conditions like IF A="Saturday" (because Saturday has different fixed Time, actually it's a half working day) the message " You've entered too many arguments for this functions" shows up.

Hope I was clear :/

4. Re: If formula with calculations

With your first formula, you want to test C4 for Monday and leave the cell blank if C4 is not Monday. You are doing that with the ,"") . Then you want to modify the formula to check for C4=Saturday, if it's not Monday. The Saturday test must replace the "" argument in the original formula.
=IF(C4="Monday",(J1-D4)+(E4-K1),IF(C4="Saturday",(J2-D4)+(E4-K2),""))

5. Re: If formula with calculations

Thank you, protonLeah.

I appreciate a lot you help.

6. Re: If formula with calculations

This thread is Solved.
Thanks to protonLeah

7. Re: If formula with calculations

If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

8. Re: If formula with calculations

Thanks, dear.
Done.

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1