mikelietz / 18xx-sheet-scripts

0 stars 0 forks source link

1846 cert limit is broken #8

Closed mikelietz closed 4 years ago

mikelietz commented 5 years ago

1846 seems to be referencing a lookup that isn't there, and the cert limit does not decrease properly when a company is closed. See https://docs.google.com/spreadsheets/d/1kUP1th_3e98TimNuwAKEBLZF3jW9W-oHeIRF5SCUYHU/edit for example.

mikelietz commented 4 years ago

Can be fixed with a simpler, uglier formula like

=IF(A1=5,11,IF(A1=4,12,IF(A1=3,14,0))) -IF(COUNTIF(H10:U10,"=0")>0, IF(A1=3,3,IF(A1=4,INDEX({2,4,4,4,4,4,4},COUNTIF(H10:U10,"=0")),IF(A1=5,INDEX({1,3,5,5,5,5,5},COUNTIF(H10:U10,"=0")),0))) ,0)

mikelietz commented 4 years ago

Fixed in sheet version 1.2.