Difference between positive negative (any variation)

roondog248

New Member
Joined
Aug 21, 2014
Messages
7
ScoreYards/PointYards / Play
OffenseDefense+/-OffenseDefense+/-OffenseDefense+/-
Chicago Bears23.025.0-2.015.214.90.35.36.2-0.9
182121151818212831
Carolina Panthers18.324.0-5.818.015.62.45.36.0-0.6
281727271421232325
----->3.8
----->​
2.10.2

<colgroup><col style="width: 75px"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"></colgroup><tbody>
</tbody>



All the metrics under Offense & Defense are the result of a vlookup formula, so they change everytime depending on the team.
In the +/- column, (difference between the differences) both of the numbers will sometimes be positive, sometimes negative, sometimes positive & negative.

As you can see, the number (in red) in the H column is incorrect.
I need help figuring out a formula that will retain all the rules for subtracting positive, negatives (every variation)
Any help would be greatly appreciated.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
As you can see, the number (in red) in the H column is incorrect.
1. I can only see that for certain if you clearly point out what the correct result should be and how you calculate that correct result.

2. Is the "0.2" at the bottom right of your table correct? If so, how was it calculated? If not, what should it be, and why?
 
Upvote 0
ScoreYards/PointYards / PlayNet Yards/Pass
OffenseDefense+/-OffenseDefense+/-OffenseDefense+/-OffenseDefense+/-
New York Jets-4.3-6.40.70.3
San Diego Chargers9.8-6.9-0.12.1
----->14.0
----->​
0.5
----->​
0.8
----->​
1.8

<colgroup><col style="width: 75px"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"></colgroup><tbody>
</tbody>

in order to make this less confusing refer to this one, b/c it has only the values in question.

All the values with the arrow next to them are correct. I worked them out on a calculator.
1st column of number is - - +
2nd is - - -
3rd is + - -
4th is + - +

all these numbers will change every time i enter a new team. So the only thing i can think of is 3 or 4 nested If formulas that apply all the rules of subtracting positives and negatives.
 
Upvote 0
After many many hours of aggravation I think I have just figured it out.
As I attempted to articulate the comment that would respond to yours, I had to think about all the rules of subtracting positive and negative numbers and any variation (+ - +) (- - +) (+ - -) + - +) and then transfer those rules to Excel talk.

I think I have figured it out....

=IF(AND(E17>0,E19>0),MIN(E17,E19)-MAX(E17,E19),IF(AND(E17<0,E19<0),(ABS(E17-E19)),IF(AND(E17>0,E19<0),MAX(E17,E19)-(MIN(E17,E19)),MIN(E17,E19)-(MAX(E17,E19)))))

I'm sure I will find a few flaws in this formula as the values change with the teams.
Hopefully I will be able to adjust.

If anyone sees a flaw, or has an easier way, let me know.

thanks
 
Upvote 0
I'd still ask for the rules. Try to make an exhaustive set of examples along with the manually calculated desired results.
 
Upvote 0
I think I have figured it out....

=IF(AND(E17>0,E19>0),MIN(E17,E19)-MAX(E17,E19),IF(AND(E17<0,E19<0),(ABS(E17-E19)),IF(AND(E17>0,E19<0),MAX(E17,E19)-(MIN(E17,E19)),MIN(E17,E19)-(MAX(E17,E19)))))

If anyone sees a flaw ...
Yes, I see a flaw, though I don't know if it's a flaw in your formula or a flaw in the red statement below.
The flaw is that the formula above and the red statement below cannot both be correct because the formula does not produce the values you state are correct, as evidenced by my screen shot below.
Hence the need for an accurate response to Aladin's request.

ScoreYards/PointYards / PlayNet Yards/Pass
OffenseDefense+/-OffenseDefense+/-OffenseDefense+/-OffenseDefense+/-
New York Jets-4.3-6.40.70.3
San Diego Chargers9.8-6.9-0.12.1
----->14.0
----->​
0.5
----->​
0.8
----->​
1.8

<colgroup><col style="width: 75px"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"></colgroup>


All the values with the arrow next to them are correct. I worked them out on a calculator.
1st column of number is - - +
2nd is - - -
3rd is + - -
4th is + - +

all these numbers will change every time i enter a new team. So the only thing i can think of is 3 or 4 nested If formulas that apply all the rules of subtracting positives and negatives.

Excel Workbook
CDEFGHIJKLMN
17-4.3-6.40.70.3
18
199.8-6.9-0.12.1
20
21Stated as correct----->14----->0.5----->0.8----->1.8
22
23Post #7 formula:-14.10.50.8-1.8
roondog248
 
Upvote 0
you're right, that formula is inaccurate.
I'm not sure what you want me to explain.
i'm looking for the formula to find the difference between the two numbers, whether that is positives - negatives, negatives - negatives, positives - positives.
With all due respect, I think those rules are common knowledge.

I will have to adjust those flaws late on today after work.
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,954
Members
449,198
Latest member
MhammadishaqKhan

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