# IF FUNCTIONS

Closed
Matt Wilhelm - Feb 6, 2010 at 04:03 PM
Matt Wilehlm - Feb 9, 2010 at 02:02 AM
Hello,

I have this formula and I am trying to get it to calculate my overtime wage and my regular wage in the same cell. V16 is my overtime pay and V15 is my regular pay. The first part of the equation which is for my overtime works correctly but I can't seem to get the last half to calculate regular pay. If anyone has any idea they are greatly appreciated.

Matt

=IF(SUM(AE14)>40,(SUM(AE14)-40)*V16)+IF(SUM(AE14)<=40,-SUM(AE14>40,(SUM(AE14)*V15)))

## 2 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Feb 6, 2010 at 08:01 PM
[QUOTE]
=IF(SUM(AE14)>40,(SUM(AE14)-40)*V16)+IF(SUM(AE14)<=40,-SUM(AE14>40,(SUM(AE14)*V15))) [/QUOTE]

Instead of giving your equation you should have given the logic
Let me phrase the logic

If AE14 is greater than forty the cell should have the value of
(AE14-40)*V16+AE14*V15
Otherwise (means that if AE14 is less than equal to 40 then the value should be
AE14*V15

If this logic ok then the equation is

=IF(AE14>40,(AE14-40)*V16+AE14*V15,AE14*V15)

suppose AE14 is 45(more than 40),V16 is 20 and V15 25

then the above equation will give 1225

suppose AE14 is 35(less than or equal to 40) (naturally V15 and V16 remain the same the above equation will give 875

now I do not know whether you want to find this calculation for one person or for a number of people.
How is your database configured

POST BACK FEEDBACK
OK so the terminology is right but the formula still doesn't seem to want to work. I was able to tweak it to look like this and it works great and comes up with all the correct numbers except when my employee works less than 40 hours and than it just gives a 0 as a total instead of their hours worked. I hope this is enough information, I really do appreciate the help from all.

Again I want the formula to calculate all of my hours that are equal to, or less than 40 and multiply that number by v5 to get me total regular wages without overtime.

=IF(AE4>40,AE4-40)*V6+IF(AE4>=40,AE40+40)*V5