Results 1 to 17 of 17

Thread: [RESOLVED] need formula - unique combination

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    Question [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:
    1. a       b       c       d        e      value
    2.  
    3. 1                   1
    4.     2               2
    5. 1   2               3
    6.         4           4
    7. 1       4           5
    8.     2   4           6
    9. 1   2   4           7
    10.             8       8
    11. 1           8       9
    12.     2       8       10
    13. 1   2       8       11
    14.         4   8       12
    15. 1       4   8       13
    16.     2   4   8       14
    17. 1   2   4   8       15
    18.                 16  16
    19. 1               16  17
    20.     2           16  18
    21. 1   2           16  19
    22.         4       16  20
    23. 1       4       16  21
    24.     2   4       16  22
    25. 1   2   4       16  23
    26.             8   16  24
    27. 1           8   16  25
    28.     2       8   16  26
    29. 1   2       8   16  27
    30.         4   8   16  28
    31. 1       4   8   16  29
    32.     2   4   8   16  30
    33. 1   2   4   8   16  31


    Thanks for your help!
    Last edited by billwagnon; Nov 5th, 2002 at 01:58 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width