Massive 'IF' Function Problem!! VCE SAC!

steviiiiiiee

New Member
Joined
Oct 30, 2010
Messages
4
Hey Guys,

I'm doing a Case Study for school on Excel, but our teacher didnt teach us this.

What we have to do is list how many hours the worker has worked or underworked.

For example, for Worker A as Worked 30 hours, but was expected to work 60 hours, he Under Worked 30 hours, so in the 'Under Worked" Column, I would put 30.

I'm using

=SUM(H2-F2)

Just a simple subtraction etc.

Anyway. What I want to do is prevent a negative piece of data being submitted, so if someone over worked, a negative piece of data would go into "Under Worked". I just want it to equal zero, but still be custmizable is the data changes!


Thanks in advance! :)
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Actually No, it does not work. It only shows the data as Zero, but when I times the data with another cell it doesnt act as zero......??!?
 
Upvote 0
Hi,

First thing, your formula is redundant
=SUM(H2-F2)

Just write =H2-F2.

if H2 = 2 and F2 = 1, your formula says =Sum(2-1) which becomes =sum(1) which is 1.. see the redundancy?

Now to only do the math when greater than 0, how about
assuming
H2 = Expected
f2 = Worked

=if(H2>=F2,h2-f2,0) This will show hours underworked.

In a separate cell, if you want to show overworked

=if(H2<F2,F2-H2,0)
<F2,F2-H2,0)<F2,F2-H2,0)<F2,F2-H2,0)< p>
Does that help?
 
Last edited:
Upvote 0
=IF(H4>=F4,H4-F4,0)

I used For under Worked Hours
and WORKED!!

and for Over Worked Hours I used

=IF(F2>=H2,F2-H2,0)

and it WORKED!!

Thanks you both for your quick replies, if I need anymore help I'll just post in here again.

Once Again thanks A lot! :biggrin::biggrin:
 
Upvote 0
You are welcome and welcome to the board, if you have any new questions, start a new thread. You will have the benifit of others here with superior brain power who will be more apt to look at a new thread, than here.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top