Dividing negative numbers for result 0

jkags8

New Member
Joined
Jul 17, 2017
Messages
2
My spreadsheet is for a college. I have two cells - one shows how many courses are left to be assigned (to an instructor), the others shows the total remaining available funds. I divide them to show the average funds available for each course instructor.

Sometimes the numbers are positive, sometimes they're negative. If they're negative or 0 (ie you have no courses left to hire for, or you've hired too many people, or you've spent too much money) I want the calculation to show 0. Currently dividing two negative numbers yields a positive result, so if they're overhired or overspent it looks like they still have funds.

Thanks for the help.

Example:
[TABLE="width: 353"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Remaining courses to be assigned[/TD]
[TD] (0.32)[/TD]
[/TR]
[TR]
[TD]Available funds for remaining courses[/TD]
[TD] (4,349)[/TD]
[/TR]
[TR]
[TD]Average avail per course for unassigned [/TD]
[TD] 13,592[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
If you want an answer to be positive or zero, I suggest you something like this

Code:
=IF(B3/C3>0,B3/C3,0)

Edit : I miss readed your post

Code:
=IFERROR(IF(B3>0,B3,0)/IF(C3>0,C3,0),0)
 
Last edited:
Upvote 0
Thank you, that works when both numbers are negative. But I need it to work regardless if they're - or +. For example, here's a scenario from a different department:

Remaining courses to be assigned 8
Available funds for courses 50,090
Average available per course 6261

When I use this formula I also get 0 for the average available, instead of the correct value of 6261.

If you want an answer to be positive or zero, I suggest you something like this

Code:
=IF(B3/C3>0,B3/C3,0)

Edit : I miss readed your post

Code:
=IFERROR(IF(B3>0,B3,0)/IF(C3>0,C3,0),0)
 
Upvote 0
Hi, to all!

Check this:

Book1
AB
1Remaining courses to be assigned-0.32
2Available funds for remaining courses-4,349
3Average avail per course for unassigned0
Hoja3
Cell Formulas
RangeFormula
B3=IF((B1>0)*(B2>0),B2/B1,)

Blessings!
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,242
Members
452,623
Latest member
russelllowellpercy

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