Looking for formula that will subtract when bottom number is larger than top number

Robert Wyatt

Board Regular
Joined
Jul 15, 2012
Messages
97
Office Version
  1. 2019
Platform
  1. Windows
I have had this up before and I'm sorry for bringing it back again, but I need to have a formula that will subtract if the bottom number is larger than the top. Let's say B6 is 840.00 I would need to have the formula subtract the bottom number from the top to show how much I'm over the limit of the annual amount
Book1
ABC
1Social Security Monthy/Annully Gross Wages Amount
2Allowed Monthly$ 1,770.00
3Estamited Monthly $ 798.48$ 1,596.96
4Difference$ 173.00
5Allowed Annually$ 21,240.00
6Estamited Annually$ 798.48$ 20,760.48
7Difference$ 480.00
Sheet1
Cell Formulas
RangeFormula
C2C2=ROUND(SUM(C5/12),2)
C3C3=IF(B3=0,0,ROUND(SUM(B3*2),2))
C4,C7C4=IF(OR(C3=0,C2=0),0,ROUND(IF(C3>C2,0,C2-C3),+ROUND(IF(C3<C2,0,C2-C3),2)))
C6C6=IF(B6=0,0,ROUND(SUM(B6*26),2))
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Do you mean something like this?
Excel Formula:
=IF(B6>B3,B6-B3,0)
or simply just:
Excel Formula:
=MAX(B6-B3,0)

Also, note that your SUM functions in these part of your formulas are not needed:
SUM(C5/12)
SUM(B3*2)
SUM(B6*26)


To use the SUM function on a single cell serves no purpose whatsover, and can be eliminated, i.e.
C5/12
B3*2
B6*26


The SUM function is used to sum up a RANGE of cells, i.e.
SUM(A3:D3)
would be equivalent of:
A3+B3+C3+D3

I also often see people use SUM and addition in the same formula, which is redundant, and unneccessary.
So for the formula above, I often see:
SUM(A3+B3+C3+D3)

You only need one or the other (SUM function OR each +, not both), like I show above.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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