Disregard Negative Results

MrDB4Excel

Active Member
Joined
Jan 29, 2004
Messages
334
Office Version
  1. 2013
Platform
  1. Windows
I am trying to get the minimum value in a column (in this case column “J”) but the formulas that are used to insert results in the column I need the minimum from are as follows:
=SUM(D10-$K$3), with each successive row an increase in the D row; e.g. =SUM(D11-$K$3), =SUM(D12-$K$3)…
K3 equals 13,850,000 so in the last row where other data is not yet present in columns “A, B, C, & D” then the value in column “J” shows -13,850,000.
How can I get the negative value to not show and instead during the =MIN(J:J) lookup it truly only looks at positive values where data has been entered in columns “A, B, C, & D” and disregards all rows after the last row where data has been entered in columns “A, B, C, & D”? Example, row 109 has data in columns “A, B, C, & D” and the result of =SUM(D109-$K$3) is 1,341,602. Then row 110 the value showing in J110 is -13,850,000
This seems straightforward to me without the need for an Xl2bb mini-sheet but if it is needed I will create one.

I tried this formula: =IFERROR(IF(SUM(D10-$K$3)=0,”“,(D10-$K$3))),”“) but then I got this message, seen in the attached image:
Any suggestions are very much welcome and appreciated.
 

Attachments

  • TooFewArgumentsForThisFunction.png
    TooFewArgumentsForThisFunction.png
    7.7 KB · Views: 4

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I do find your post a bit confusing, and it would be helpful to see actual data and expected results, unless my formula at the very bottom of this post fixes your issue and gives you exactly what you want.

Among some of the things that are not clear:

- You mention columns A, B, C, and D, but your formula only reference column D of those four columns.

- I am not sure why you are using "SUM" here, it serves no purpose:
Excel Formula:
=SUM(D11-$K$3)
SUM is used to add up (sum) a range of cells. If you simply want to subtract two number, you would simply write:
Excel Formula:
=D11-$K$3
Adding "SUM" to the equation serves no purpose.
The subtraction happens first, resulting in a single number. So you then would be summing a single number (which will just return that number).

Your formula could be re-written as (you also have an extra ")" in there, which is causing your error):
Excel Formula:
=IFERROR(IF(D10-$K$3=0,"",(D10-$K$3)),"")
However, that just checks for errors and if the value is exactly equal to zero, and does not handle situations where it might be less than zero.
That would look like this:
Excel Formula:
=IFERROR(IF(D10-$K$3<=0,"",(D10-$K$3)),"")
 
Upvote 0
Solution
Yes, I see how it was confusing to other eyes, but no matter because your formula was perfect and spot on, thank you!!!
My mention of columns A, B, & C only indicated those columns along with column D were blank until the current date's data was input.
I shall attempt in future posts to eliminate confusion, thanks for the heads up.
 
Upvote 0
Excellent!
I am glad I was able to help and that it worked out for you.
 
Upvote 0

Forum statistics

Threads
1,215,203
Messages
6,123,627
Members
449,109
Latest member
Sebas8956

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