Mark different numbers on a list

I need help with a project on Numbers...
I have a list with several numbers (first column), i want to when i write a number on a specific cell (second column), automaticaly the first column with this list numbers mark me the maximum numbers possible to create this result, for example...
Header 1
Header 2
12
42
12
8
4
3
3
2
2
1
I want to with the 42 number (wroten manually) Numbers mark me (i don't know, with a color or something) the 12 12 8 4 3 3. and not marks me the 2 2 1
It's possible or it's a little bit crazy idea?

I believe the script below will give you the full answer to your question. It is a simple script with nothing fancy. The table it works with is also not fancy. A very similar question was asked nearly two years ago and this was the solution.
The script works on Table 1 of Sheet 1 unless you modify the script.
The target number you want to reach must be in cell B1
The number of elements (the number of values in your list) must be in B2. You can have up to 26 elements
The list of numbers must start at cell B3. Sort them ascending as in the table below.
When you run the script it will put a 1 next to the numbers to use
Cell C1 =SUMPRODUCT(B3:B19,C3:C19) verifies the result
To create and use the script:
Start the Automator application
Create a Service using no input for application Numbers
Use the Run Applescript action from the Utilities folder
Copy the script from below and paste it into the action, overwriting the default text
Save it with a descriptive name such as Numbers Recursion
You can now run it from the Numbers/Services menu
global target
global nbr_elem
property stat : {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
property statb : {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
property elems : {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
global best
on run
          local i, r
          set best to 0
          tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
                    set target to value of cell 1 of column 2
                    set nbr_elem to value of cell 2 of column 2
                    repeat with i from 1 to nbr_elem
                              set r to i + 2
                              set item i of elems to value of cell r of column 2
                    end repeat
          end tell
          eval(0, 1)
  store_sol()
end run
on copy_stat()
          local i
          repeat with i from 1 to nbr_elem
                    set (item i of statb) to item i of stat
          end repeat
end copy_stat
on store_sol()
          local i, r
          tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
                    repeat with i from 1 to nbr_elem
                              set r to i + 2
                              set value of cell r of column 3 to item i of statb
                    end repeat
          end tell
end store_sol
on eval(total, pos)
          local tt, tb
          if pos ≤ nbr_elem then
                    set item pos of stat to 0
  eval(total, pos + 1)
                    set item pos of stat to 1
                    eval(total + (item pos of elems), pos + 1)
          else
                    set tt to total - target
                    if tt < 0 then set tt to -tt
                    set tb to target - best
                    if tb < 0 then set tb to -tb
                    if tt < tb then
                              set best to total
  copy_stat()
                    end if
          end if
end eval

Similar Messages

  • I have two cell phone, different numbers.  Each has their own apple id.  How can i merge them so apps on one show on the other but keep their emails addresses separate on their own phone?

    Have two cell phones, different numbers.  Each has their own apple id.  How can I merge them so apps purchased on one phone show on the other.  But.as each has their own email address, I want to keep these email addresses separate on their own phone?  Thanks.

    We do this in my family now.  We have one account for purchases, so it is used to share music and apps (I think that is in Settings/iTunes & App Stores).  Each iDevice has this configured.
    Then, each of us has our own iCloud account that is configured under Settings/iCloud.  That then allows us to have our own Mail/Contacts/Calendars/Reminders/Safari Bookmarks/Notes/Passbook/Photo Stream/Documents & Data/Find My iPhone/and Backup.  That Backup piece is pretty sweet and comes in handly if you replace your iDevice.  You can just restore from it.
    So we all share the Apple Store account but we all have our own iCloud accounts to keep the rest seperate or things like you mentioned are a nightmare.
    In answer to what iCloud does for you: http://www.apple.com/icloud/features/
    Think of it as an internet based ("cloud") area for all of those items listed in my response.  What you need to remember is photo stream only maintans the last 1000 pictures so don't count it as a complete backup solution for your pictures.  Even though I rarely sync with a computer these days, I do still try to sync my phone with iPhoto (I have an iMac) so that I have copies of all of my pictures.  1000 may not stretch as far as it sounds.
    Message was edited by: Michael Pardee

  • PDF file shows different numbers of text blocks in CC 2014 and CS6

    Hi,
    I've inherited a file at work that displays different numbers of text blocks, depending on the version of Acrobat used to view the file. Here's the specific issue:
    As viewed in CC 2014:
    "Chapter 1 - Chapter One Title": Appears as two text blocks -- one for "Chapter 1 - " and one for "Chapter One Title"
    As viewed in CS 6:
    "Chapter 1 - Chapter One Title": Appears as a single text block -- "Chapter 1 - Chapter One Title"
    This occurs only with regard to single-digit chapter numbers that are whole numbers. So:
    Chapter 1, Chapter 5, and Chapter 7 entries appear as two blocks in CC 2014, one block in CS6.
    Chapter 2.0, Chapter 6.1, Chapter 10, entries appear in single blocks in both CC 2014 and CS6.
    The PDF file was created -- I believe -- through the save-to-PDF feature in Word 2010.
    Any idea what's happening here?
    Thanks.
    David

    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • How can i combine different numbers spreadsheets into one numbers document?

    I am migrating from Excel. This is easy to do in Excel but I can't figure it out for Numbers. I have created four different Numbers docs and I want to have them in one document, so i can move between them conveniently and also to create a single pdf file with four sheets...which simplifies emailing to non-mac users. Can anyone tell me how i do this please?
    thx lawrence

    Hello
    Yes, select a sheet, copy it in the clipboard then paste into the main spreadsheet.
    There is no built-in tool allowing exchanges between two documents.
    Yvan KOENIG (from FRANCE vendredi 4 janvier 2008 12:20:17)

  • I have two iPhones, 1 Apple ID can I have IMessage working from both different numbers? If so how?

    I have two iPhones and need to use both with different numbers. I have one Apple ID, can I use iMessage on both phones with the different numbers? If so how

    I have two apple phones too. One for work and my personal. When setting up your apple ID on the second phone under Messages settings -> Send & Receive -> you can select the other phone that has your apple ID. I haven't done it, bc need two separate phones. But i believe that sould work. Same on your Messages on you mac. But remember iMessages only works with Apple products. All your other buddies that don't have apple you won't get their sms, on the primary phone you want to use. Hope this helps

  • I have an iPhone 4 and 5 with 2 different numbers but same Apple ID and I can't set up voicemail on the 5

    i have 2 iPhones with 2 different numbers but same Apple ID, why can't I set up voicemail on one phone

    Visual voicemail is a carrier feature, contact your cell phone provider and see if it is set up for you to use.

  • HT4528 Can I put the same information on two different i-phones with different numbers and different ID's?

    Can I put the same information on two different i-phones with different numbers and different ID's?

    Yes and no it really depends on what information you are putting on the devices.

  • Why do I have different numbers of schedulers in a 2 node AG FC running SQL2012 SP1

    In analyzing a performance issue I can see that on a 2 node Availability Group Failover Cluster with synchronous commit to a read-intent only secondary show different numbers of schedulers inside SQL looking at sys.dm_os_sys_info.
    As an example we have one set where one node shows 51 schedulers and the other node shows 28. This isn't a matter of the Primary and the Secondary because I did a failover on a pair that showed 11 and 12 schedulers. Those numbers did not change after the
    failover.
    Can anybody explain what the differences and how to correct these?
    Thanks
    Chris
     

    Hi,
    Thank you for your question. I am currently looking into this issue and will give you an update as soon as possible.
    Thank you for your understanding and support.
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • How to create an action to insert hundreds of different numbers for limited edition prints?

    Hi,
    I sell limited edition prints of a run of between 350 and 500.
    I am trying to get it set up so that my signature and the print number is included as part of the print. Here is an example:
    You'll see at bottom left there is my signature and underneath is is the print number e.g. 110/350 (this is legible when printed at 18x12" size).
    Inserting the signature and the "/350" is easy since it only needs to be done once per image.
    The difficulty comes with inserting the actual print number e.g. "110"
    At the moment I have 0 to 9 written out and scanned in as separate numbers. So to make "110" I use the "1" digit twice, plus the "0" digit. I.e. I haven't written out 1 to 500 and scanned them in all as separate numbers, I've just done the 10 digits and use those 10 digits to make all the different numbers I need.
    Is there a way to create an action that will create say 350 JPEG copies of the original file, each one with its own unique print number inserted? (And ideally automatically saved with the print number as its file name!)
    Many thanks in advance

    This Script might be able to do some of what you wanted (the startNumber and endNumber would have to be set in the Script).
    It needs a Layer Group named »numbers« to contain layers for the numbers named »0«, »1«, …
    (script edited)
    // this script saves jpg copies with numbers created from number-layers in a layer group;
    // use it at your own risk;
    #target photoshop;
    if (app.documents.length > 0) {
    // define the numbers to create;
    var startNumber = 290;
    var endNumber = 310;
    // set to pixels;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    // get doc;
    var myDocument = app.activeDocument;
    // getting the name and location;
    var docName = myDocument.name;
    var baseName = docName.match(/(.*)\.[^\.]+$/)[1];
    //getting the location;
    var docPath = myDocument.path;
    // duplicate the image;
    var thecopy = myDocument.duplicate (thecopy, false);
    // jpg options;
    var jpgopts = new JPEGSaveOptions();
    jpgopts.embedProfile = true;
    jpgopts.formatOptions = FormatOptions.STANDARDBASELINE;
    jpgopts.matte = MatteType.NONE;
    jpgopts.quality = 9;
    // get number layers;
    var numberSet = thecopy.layers.getByName("numbers");
    // collect in an array;
    var theNumbers = [numberSet.layers.getByName("0"), numberSet.layers.getByName("1"), numberSet.layers.getByName("2"),
    numberSet.layers.getByName("3"), numberSet.layers.getByName("4"), numberSet.layers.getByName("5"),
    numberSet.layers.getByName("6"), numberSet.layers.getByName("7"), numberSet.layers.getByName("8"), numberSet.layers.getByName("9")];
    numberSet.visible = true;
    // proceed if all numbers have been found;
    if (theNumbers.length == 10) {
    // hide layers;
    for (var n = 0; n < numberSet.layers.length; n++) {
    numberSet.layers[n].visible = false
    var theState = thecopy.activeHistoryState;
    // process the numbers;
    for (var m = startNumber; m < endNumber + 1; m++) {
    // the position;
    var theHor = 500;
    // create an array for the new numbers;
    var theArray = new Array;
    // the number;
    var thisString = String(m);
    // duplicate layers to create the numbers;
    for (var o = 0; o < thisString.length; o++) {
    var theNumberLayer = theNumbers[Number(thisString[o])];
    // create copy;
    var theLayer = duplicateMoveRotateScale (theNumberLayer, theHor - Number(theNumberLayer.bounds[0]), 0, 100, 100, 0);
    theNumberLayer.visible = false;
    //alert (m+"_"+o+"\n"+theNumberLayer+"\n"+theLayer);
    // set the hor to edge of the new layer;
    var theHor = theLayer.bounds[2];
    theArray.push(theLayer);
    // get the number for the file name;
    var theNumber = bufferNumberWithZeros(m, String(endNumber).length);
    //save jpg;
    thecopy.saveAs((new File(docPath+"/"+baseName+"_"+theNumber+".jpg")),jpgopts,true);
    // remove copied layers;
    //for (var p = theArray.length - 1; p >= 0; p--) {theArray[p].remove()};
    thecopy.activeHistoryState = theState;
    // close copy;
    thecopy.close(SaveOptions.DONOTSAVECHANGES);
    // reset ruler;
    app.preferences.rulerUnits = originalRulerUnits
    //that’s it; thanks to xbytor;
    ////// buffer number with zeros //////
    function bufferNumberWithZeros (number, places) {
              var theNumberString = String(number);
              for (var o = 0; o < (places - String(number).length); o++) {
                        theNumberString = String("0" + theNumberString)
              return theNumberString
    ////// duplicate layer and move, rotate and scale it //////
    function duplicateMoveRotateScale (theLayer, theX, theY, theScaleX, theScaleY, theRotation) {
    app.activeDocument.activeLayer = theLayer;
    try{
    // =======================================================
    var idTrnf = charIDToTypeID( "Trnf" );
        var desc10 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref6 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref6.putEnumerated( idLyr, idOrdn, idTrgt );
        desc10.putReference( idnull, ref6 );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc10.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc11 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc11.putUnitDouble( idHrzn, idPxl, theX );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc11.putUnitDouble( idVrtc, idPxl, theY );
        var idOfst = charIDToTypeID( "Ofst" );
        desc10.putObject( idOfst, idOfst, desc11 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc10.putUnitDouble( idWdth, idPrc, theScaleX );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc10.putUnitDouble( idHght, idPrc, theScaleY );
        var idAngl = charIDToTypeID( "Angl" );
        var idAng = charIDToTypeID( "#Ang" );
        desc10.putUnitDouble( idAngl, idAng, theRotation );
        var idIntr = charIDToTypeID( "Intr" );
        var idIntp = charIDToTypeID( "Intp" );
        var idbicubicAutomatic = stringIDToTypeID( "bicubicAutomatic" );
        desc10.putEnumerated( idIntr, idIntp, idbicubicAutomatic );
        var idCpy = charIDToTypeID( "Cpy " );
        desc10.putBoolean( idCpy, true );
    executeAction( idTrnf, desc10, DialogModes.NO );
    return app.activeDocument.activeLayer
    } catch (e) {}
    Edit: This Script just uses the layers’ horizontal bounds for orientation, so it does not address the issue I referred to earlier reagrding aesthetically pleasing spacing of the elements.

  • Why do my 2 iphones ring at the same time even though they have different numbers?

    Why do my 2 iphones ring at the same time even though they have different numbers?

    Are they sharing an Apple ID?
    On both phones:
    Settings > FaceTime > turn iPhone Cellular Calls off

  • Does camera raw 7.0 support Canon 5d mark iii? on the list it said 6.7 and 7.1 which makes confused because 7.0 is in between.

    Does camera raw 7.0 support Canon 5d mark iii? on the list it said 6.7 and 7.1 which makes confused because 7.0 is in between.

    Which version of photoshop and operating system are you using?
    If you have photoshop cs6 you should use Help>Updates to get the latest camera raw.
    Camera raw 7.0 was just the shipping version of camera raw for photoshop cs6 and you should update it to a newer version.
    The camera raw version on that list is just the oldest version of camera raw to support a particular camera and newer versions of camera raw carry on that support as well.

  • Stop the Numbers and Letter Lists!

    My wife is going crazy - please help me. She has to copy and paste questions into a blank pages doc, answer the questions then submit the completed document. The problem is that Question 1 is numbered as such and when she goes to type the answer, her answer is then number 2. It happens with part a, b , c as well always wanting to continue the list. I thought I read that you simply double return and it stops, but this is not working, nor is turning off "automatically detect lists" in preferences. How do you stop the numbering and lettering lists please?

    Thanks Peter - unfortunately that's what I found in the help menu's and it doesn't work. The more I press return the more the list keeps going, c,d,e,f,g etc. I also selected none in the lists menu, but it seemed to have no effect. Is this because the document was pasted from a word to a pages? I wonder.

  • Bar code shipment numbers on picking lists

    Dear All,
    I want to add Bar code to shipment numbers on picking lists so warehouse/shippers can scan the bar code instead of type in the number.  This would really save time on UPS shipments.  Currently the warehouse/shippers have to type each UPS shipment number twice (one time to confirm pick and one time to print packing list).  Since there are 50 - 100 UPS shipments daily, a lot of time could be saved with scanning the shipment number instead of keying.
    What can be the resolution for this? Can this be automated at  the configuration level?
    Or can it be done through the help of coding? Any ideas on this issue?
    Advises are welcome.
    Regards,

    The t.o. confirmation can be automatic at the time of t.o. creation (autoconfirm) if you desire and/or you could make the print output  to trigger at time of t.o. confirmation.
    Another option would be to paste the shipment numbers into an excel file and convert the numbers to bar code for scanning.
    You can get a very popular bar code "font" (3 of 9 barcode) free online and use it just like any other font in excel.

  • Can i sync 2 different iphone with 2 different numbers using one apple computer?

    can i sync 2 different iphone with 2 different numbers using one apple computer?

    You can sync as many devices as you like to the same iTunes account, there is no limit. You can have the same content on each device or different content, the choice is yours. iTunes will keep it all straight by device, including separate backups.

  • So i sent 2 PXTs to someone and it came up on their phone from 2 different numbers and none of them mine. I called those numbers and they were just normal people and they had no idea what had happened. How did this happen?

    So i sent 2 PXTs to someone and it came up on their phone from 2 different numbers and none of them mine. I called those numbers and they were just normal people and they had no idea what had happened. How did this happen?
    Both phones were iPhone 4s and everyone was with different carriers.

    Simple process. If an iPhone go to the Apple Store and not Verizon
    the phone from Verizon will be a refurbished device and not new unless under the 14 day worry free guarantee
    good luck

Maybe you are looking for

  • Using CSS instead of or with library item

    I built my site using Dreamweaver 8. I used the design view exclusively. I made a navigation bar as a library item. Utilizing rollovers, etc. Now I have learned I should build my site utilizing CSS and as was pointed out on this forum to me, to learn

  • The 4 or 5 finger gesture does nothing on my iPad 1. Why?

    I've read the manual in the over view and don't see that it is only applicable to iPad 2...

  • QT 7 Pro crashes when trying to export

    I just installed QT 7 Pro (win-xp). It crashes whenever I try to export. I'm a long time user of QT 6 Pro and never had a problem. I soon I select the "export" dropdown menu the application crashes and the windows error reporter. AppName: quicktimepl

  • Background images for a portlet

    Hi, Is it possble to have a background image for a portlet only, In particular I need to include the login portlet in a region but have the background of the portlet based on an image file. Thanks in advance, Brandon

  • Core Patch for 9.0.2

    Can an Oracle person let me know when the 9.0.2.1 patch will be released for Windows 2000? The unix patch has been released for a while (Patchset:2542920). Also, I've heard that this patch supports the changing of the ip address after install. Is thi