Skip to content

Instantly share code, notes, and snippets.

@coreyhermanson
Last active May 31, 2017 14:37
Show Gist options
  • Save coreyhermanson/f367b0226632b1e5b994767b916d2f7b to your computer and use it in GitHub Desktop.
Save coreyhermanson/f367b0226632b1e5b994767b916d2f7b to your computer and use it in GitHub Desktop.
Random Excel functions

Nested "If value in list" function

=IF(SUMPRODUCT(--(B1={1,11,21,31}))>0,1,
IF(SUMPRODUCT(--(B1={2,22,32,12}))>0,2,
IF(SUMPRODUCT(--(B1={3,13,23,33}))>0,3,
IF(SUMPRODUCT(--(B1={4,14,24,34}))>0,4,
IF(SUMPRODUCT(--(B1={5,15,25,35}))>0,5,
IF(SUMPRODUCT(--(B1={6,16,26,36}))>0,6,
IF(SUMPRODUCT(--(B1={7,17,27,37}))>0,7,
IF(SUMPRODUCT(--(B1={8,18,28,38}))>0,8,
IF(SUMPRODUCT(--(B1={9,19,29,39}))>0,9,
IF(SUMPRODUCT(--(B1={10,20,30,40}))>0,10,
))))))))))

Max value in range of metrics

=ArrayFormula(MAX(IF('1: Job Function'!B$2:B$125=A2,IF('1: Job Function'!F$2:F$125=TRUE,'1: Job Function'!D$2:D$125))))

Converting max metric grade to weight

=IF(E2 = 0, 0,
IF(E2 <= 10, 1,
IF(E2 <= 20, 2,
IF(E2 <= 30, 3,
IF(E2 <= 40, 4, -1
)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment