+ Reply to Thread
Results 1 to 5 of 5

How many values are used to make a certain value.

  1. #1
    Registered User
    Join Date
    05-08-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    How many values are used to make a certain value.

    Hello, I was wondering if someone could help me with this. I have attached my workbook to help you guys understand. It is just a sample though, as the file would have been too big to upload.

    Basically, in columns A,B,C and D I have 4 unique values. This goes on for about 150,000 records.
    I would like to know what is the minimum amount to use to make the values in row 1(column F onwards)

    For example, row 7 has values 1,2,3,9.
    To make 7, it would take 3 of the values (3,3,1)
    To make 8, it would take 3 of the values (3,3,2)
    To make 9, it would take 1 of the values (9)

    I attempted a huge IF function but it didn't come together as I thought it would.
    Has anyone any ideas on how to solve this? Maybe it needs VBA?

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How many values are used to make a certain value.

    What's the point of doing this?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    05-08-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: How many values are used to make a certain value.

    I'm currently doing a project at University. Trying to find the most efficient way to add up to numbers 1-99 using just unique 4 values.
    If you ask why I'm doing this, I couldn't answer. The new breed of Mathematicians; doing things that don't need doing...

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How many values are used to make a certain value.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    In F2 and copy across and down,

    =HowMany(F$1, $A2:$D2)

  5. #5
    Registered User
    Join Date
    05-08-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: How many values are used to make a certain value.

    Sorry I've taken a long time to reply.
    I can't thank you enough! It worked a charm!

    Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1