How do you get excel to automatically subract if its over a certain value?

JustOneQuestion

New Member
Joined
Jul 5, 2016
Messages
19
I am trying to get excel to show what is left over 40. Is it possible? I do not want any negative numbers either. Here is an example:
[TABLE="width: 145"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]45.25
[/TD]
[TD="align: right"]5.25
[/TD]
[/TR]
[TR]
[TD="align: right"]59.25[/TD]
[TD="align: right"]19.25[/TD]
[/TR]
[TR]
[TD="align: right"]43.25[/TD]
[TD="align: right"]3.25[/TD]
[/TR]
[TR]
[TD="align: right"]29.75[/TD]
[TD="align: right"]-10.25[/TD]
[/TR]
[TR]
[TD="align: right"]30.5[/TD]
[TD="align: right"]-9.5[/TD]
[/TR]
[TR]
[TD="align: right"]21[/TD]
[TD="align: right"]-19
[/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
All I did was subtract 40 from column A. But I do not want the values in B if it is negative. If the value in A isn't over 40, I do not want anything in column B. I tried a countif formula, but that will either take the whole number, or only a 1. Neither of which helps me.

Any thoughts?

Thanks!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Assuming 45.25 is in cell A2 (change to suit) try this:

=IF(A2>=40,A2-40,0)

Robert
 
Upvote 0
Hi,

This will also work:


Excel 2010
AB
145.255.25
259.2519.25
343.253.25
429.750
530.50
6210
Sheet1
Cell Formulas
RangeFormula
B1=MAX(0,A1-40)
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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