[RESOLVED] need formula - unique combination
A number is generated by adding any combination of a,b,c,d, or e where a = 1, b = 2, c = 4, d = 8, e = 16.
What I want to determine from the number is which of the combinations was used.
Is there a simple way to do this with a formula or a loop (instead of a select case for every possible result)?
I know if it's odd then it must include "a" but I can't get past that step.
I have made a spreadsheet of possible values:
VB Code:
a b c d e value
1 1
2 2
1 2 3
4 4
1 4 5
2 4 6
1 2 4 7
8 8
1 8 9
2 8 10
1 2 8 11
4 8 12
1 4 8 13
2 4 8 14
1 2 4 8 15
16 16
1 16 17
2 16 18
1 2 16 19
4 16 20
1 4 16 21
2 4 16 22
1 2 4 16 23
8 16 24
1 8 16 25
2 8 16 26
1 2 8 16 27
4 8 16 28
1 4 8 16 29
2 4 8 16 30
1 2 4 8 16 31
Thanks for your help!