+ Reply to Thread
Results 1 to 8 of 8

Count added pairs

  1. #1
    Registered User
    Join Date
    08-19-2019
    Location
    Vancouver
    MS-Off Ver
    365 Business
    Posts
    5

    Count added pairs

    Hello!

    Wondering if there is a way to get Excel to count up number of items that add up to 48 in a most efficient way. No macros/vba please. See attached for more details.
    Untitled1.png

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Count added pairs

    You could use Solver (a built in add-in to excel to achieve this). There are many solver tuitorials - including microsoft site. If that is not enough, please attach a SMALL sample Excel workbook(s) (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. (If trere are typical cases like: all unique values/duplicates could occur, day/night, nobody present/several persons at once, before/on/past due, etc. - please show them all or at least indicate in text) The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution(s) is/are also shown (mock up the results manually).

    3. Make sure that all confidential/restricted information (either personal or business) like real e-mails, social security numbers, bank accounts, etc. is removed first!!

    To attach an Excel file you have to do the following: Just before posting, scroll down and press Go Advanced button and then scroll down and press Manage Attachments link. Now follow the instructions at the top of that pop-up screen.
    Best Regards,

    Kaper

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,031

    Re: Count added pairs

    Welcome to the forum.

    Unfortunately, 'latest' is no help to us in terms of your Excel version, as there are desktop and subscription models. Please clarify in your profile - is it Excel 2019 or Office 365? And yes, it does and will make a difference, so please get it updated for us. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    08-19-2019
    Location
    Vancouver
    MS-Off Ver
    365 Business
    Posts
    5

    Re: Count added pairs

    Thanks guys!

    Yeah solver is definitely a no-go. It would have to be purely formula driven - with no user interaction..?
    Attached is the file. Perhaps not possible?
    Attached Files Attached Files

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Count added pairs

    OK, I think in such case - always either one or two cuts pert panel, and no need for the optimization of the remaining part, it can be done with formulas.

    See attached file - there are 2 helper columns (as your input data have empty cells inside) sorted ascending and descending with formulas (the second uses SMALL instead of LARGE) like:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    then formula for first cut is very short - just take the next large cut (until all cuts were done):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    while with second cut, we not only have to check if we still have cuts to do, but also check if together with longer cut it will fit the panel:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    the key part here is (used twice) calculation of which small piece we have available (not yet cut) by counting all above listed cut pieces):
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Legend:
    green cells are simple formulas to count input cuts and used panels (every used panel have at least first cut) yellow cells
    Yellow cells contain above formulas copied down (to gray ones).

    Your "perhaps not possible" ws quite motivating :-) And I spend quite some time trying to produce formulas which would mimmic VBA approach - just a table or collection where you select biggest one and find the biggest out of remaining, which would fit.
    Complicated and hardly legible.
    But then I realized, that because we have no chance to make 3 or more cuts of one panel, and have no limits for optimization of remains, just want to minimize the number of used panels, we can always use (try to) the smallest one not yet cut.

    So here it is :-)
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-19-2019
    Location
    Vancouver
    MS-Off Ver
    365 Business
    Posts
    5

    Re: Count added pairs

    Kaper - it will take me time to digest all of this... But THANK YOU!

    Let me spend some time on it tomorrow or day after and i will let you know!

  7. #7
    Registered User
    Join Date
    08-19-2019
    Location
    Vancouver
    MS-Off Ver
    365 Business
    Posts
    5

    Re: Count added pairs

    OK - Kaper... I am afraid I have wasted your time. If you are ever in Vancouver, lunch is on me!!!
    I actually have an additional column that complicates things way too much - the height column. I am pretty sure Excel cannot handle this with formulas.
    Suppose you need an addon that is 30" wide and 150" tall.
    You can get this from a full 48" panel that gives you a leftover that is 18" wide x 150" tall. This means that this leftover can create 3 more addons of 18" wide that 50" tall... or 2 x 18"x75"tall...
    Is there a way to average this somehow?
    Not sure if any of this makes sense to you.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-19-2019
    Location
    Vancouver
    MS-Off Ver
    365 Business
    Posts
    5

    Re: Count added pairs

    The end goal is to figure out the total area of the actual panels together with panels required to form the addons.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. To count and list the pairs of numbers data help
    By subra2015 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-27-2016, 02:14 AM
  2. [SOLVED] Count pairs of values in adjacent columns (either way around)
    By Alfie101 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-23-2016, 03:50 AM
  3. How can I write a formula to count pairs (2 rows)?
    By ccarmichael in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-22-2015, 12:26 AM
  4. Count pairs within a spectrum
    By Nspencer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2014, 06:19 AM
  5. Count number of pairs between 2 columns
    By Johnald in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-09-2013, 06:46 PM
  6. Count Pairs of Numbers
    By semperfi360 in forum Excel General
    Replies: 12
    Last Post: 02-13-2009, 11:10 AM
  7. Count pairs
    By Excelenator in forum Excel General
    Replies: 2
    Last Post: 10-02-2006, 06:25 AM

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