You had the true answer here – Tables and tables syntax – Did the rest of the guys get it? ]]>

The following formula is sued on upto 52 entries per row for 30 rows (weekly data input calculation)

=IF(ISBLANK(INDIRECT(“R[-1]C”,FALSE)),”ERROR”, IF(INDIRECT(“R[-1]C”,FALSE)>INDIRECT(“R[-1]C[1]”,FALSE),IF(ISBLANK(INDIRECT(“R[-1]C13″,FALSE)),”ERROR”,INDIRECT(“R[-1]C[1]”,FALSE)+INDIRECT(“R[-1]C13”,FALSE)-INDIRECT(“R[-1]C”,FALSE)),INDIRECT(“R[-1]C[1]”,FALSE)-INDIRECT(“R[-1]C”,FALSE)))

]]>=IFERROR(IF(ISBLANK(RC[1]),”ERROR”,IF((IFERROR(IFERROR(INDIRECT(“RC[8]”,FALSE)/RC[3],INDIRECT(“RC[8]”,FALSE)/(RC[3]+1)),”ERROR”)-2)<(RC[1]*1.25),"reorder","ok")),"ERROR")

=IF(ROUNDDOWN(IFERROR(IFERROR(INDIRECT("RC[6]",FALSE)/RC[1],INDIRECT("RC[6]",FALSE)/(RC[1]+1)),"ERROR"),0)<52,

ROUNDDOWN(IFERROR(IFERROR(INDIRECT("RC[6]",FALSE)/RC[1],INDIRECT("RC[6]",FALSE)/(RC[1]+1)),"ERROR"),0),

ROUNDDOWN(IFERROR(IFERROR(INDIRECT("RC[6]",FALSE)/RC[1],INDIRECT("RC[6]",FALSE)/(RC[1]+1)),"ERROR")/52,0)&" years"

=IF(ISBLANK(INDIRECT("R[1]C[5]",FALSE)),"ERROR", ROUNDUP(AVERAGE(OFFSET(INDIRECT("R[1]C[5]",FALSE),0,0,1,16)),0))

=IF(IFERROR(IFERROR(INDIRECT("R[-1]C[6]",FALSE)/RC[2],INDIRECT("R[-1]C[6]",FALSE)/(RC[2]+1)),"ERROR")INDIRECT(“R[-1]C[1]”,FALSE),IF(ISBLANK(INDIRECT(“R[-1]C13″,FALSE)),”ERROR”,INDIRECT(“R[-1]C[1]”,FALSE)+INDIRECT(“R[-1]C13”,FALSE)-INDIRECT(“R[-1]C”,FALSE)),INDIRECT(“R[-1]C[1]”,FALSE)-INDIRECT(“R[-1]C”,FALSE)))

So if anyone is interested in my workbook or helping me out i would greatly appreciate it. I am way beyond my understanding at this point as far as making the thing I created and works, into a more efficient and better performing sheet.

I also have a mess of conditional formatting that highlights stock levels, errors, and a few other things. No idea if conditional formatting is a big performance concern or not.

]]>Z.M. Berrebi and Jacques Silber (1985) “The Gini coefficient and negative income: a comment.” Oxford Economic Papers. 37:525– 526. https://academic.oup.com/oep/article-abstract/37/3/525/2361128

And these Italian folks then expanded the formula to include situations in which most of the wealth/income values are negative, and if I am reading their paper right, even when the sum of wealth/income is zero or negative:

Emanuela Raffinetti, Elena Siletti, and Achille Vernizzi, (RSV)

“On the Gini coefficient normalization when attributes with negative values are considered”

Statistical Methods and Applications, (2015) 24:507–521

https://link.springer.com/article/10.1007/s10260-014-0293-4

An earlier version of the paper is available here: https://www.researchgate.net/profile/Elena_Siletti/publication/299566579_Inequality_measures_and_the_issue_of_negative_incomes/links/59d342ae4585150177f92cad/Inequality-measures-and-the-issue-of-negative-incomes.pdf

They provide a module for the R statistical package as described here: https://cran.r-project.org/web/packages/GiniWegNeg/GiniWegNeg.pdf

Here is an implementation of this Gini-RSV in Python using some commands from the numpy library code: https://github.com/agcopenhaver/spatial_nGINI

The value of T is the total sum for all households, T+ is the sum of all positive amounts, and T- is the sum of all negative amounts.

It may be years (or decades) before mathematicians decide that this is the best Gini formula for addressing negative values, but right now this looks like a good formulation.

]]>It would be interesting to see what the Wikipedia suggestion of half the relative mean absolute difference gives.

]]>You can see this by using the 10 numbers in their example: -500, -300, -300, -100, 200, 300, 300, 400, 500, 500. If you just calculate the regular Gini coefficient, you get 1.940 — a ludicrous result. If you add 500 to each number, G=0.323; if you add 600 to each number G=0.277.

Using their normalized version, produces G*=0.9065. This intuitively seems like a more appropriate value for this dispersion. I’m not a mathematician and haven’t studied this enough to know if their formulation is a good one or if it has any acceptance by other scholars.

And I also don’t know how to translate their formulas into Excel.

Perhaps Angus Deaton knows if normalized G* is accepted by the math community and if he has a way to translate that into code.

[By the way, this UN FAO document http://www.fao.org/docs/up/easypol/329/gini_index_040EN.pdf has an understandable analysis of Gini which I can follow (if I study it carefully).] ]]>