1
votes

I want to take the value in a row and subtract the value in that group/category which is closest to 0. In other words, if I have a table

Col1     Col2 
A          -4
A          -9
A           1
B          10
B          13
B          19

Everything in the A category should be Col2 – 1 (because 1 is the closest to zero in the A group). Everything in the B category should be Col2 – 10 (because 10 is closest to zero in the B group).

Any suggestions on how to go about this?

1

1 Answers

1
votes

If your table is named Table1, then this should work:

=[Col2]-MINX(FILTER(Table1,[Col1]=EARLIER([Col1])),ABS([Col2]))

enter image description here