jjfrosty1

Q: How can I find duplicates in Numbers?

How can I find duplicates in Numbers?

Do I search each field or is there a short cut?

iMac (21.5-inch Mid 2011), OS X Mountain Lion (10.8.4)

Posted on Jul 19, 2013 9:47 AM

Close

Q: How can I find duplicates in Numbers?

  • All replies
  • Helpful answers

first Previous Page 3 of 5 last Next
  • by k8ty68,

    k8ty68 k8ty68 Mar 18, 2014 1:40 PM in response to SGIII
    Level 1 (0 points)
    Mar 18, 2014 1:40 PM in response to SGIII

    Thanks, this was the easiest for me! can this be put in the automater like the other applescript?

    Im a complete beginner, so apologies for the hassle, i appreaciate yr help lots!

  • by SGIII,

    SGIII SGIII Mar 18, 2014 2:06 PM in response to k8ty68
    Level 6 (10,796 points)
    Mac OS X
    Mar 18, 2014 2:06 PM in response to k8ty68

    Here it is in a Get Missing Values Automator Service. (Dropbox dowload)

     

    Usage is as described above: select the cells, run it by making a pick from the Services menu, paste the values wherever you want.

     

    If you want to change the range from 1-100 to something else you can open the workflow in Automator and change the numbers after rangeStart and rangeEnd at the top of the script.  To open it in Automator you can hold down the option key in Finder and in the menu Go > Library > Services, then doubleclick the .workflow package.  If you need to delete it from your Services menu just send the .workflow package to the trash the way you would any other Finder item.

     

    BTW, making an Automator Service from an AppleScript is quick and easy. Just open Automator, File > New, choose 'Service' as the type of document, drag a Run AppleScript action from the left into the right pane (to find that action just type 'apple' into the search box), and paste the script into the action, in this case replacing all the default code that Automator suggests.  Choose 'No Input' after 'Service receives' and choose 'Numbers.app' after 'in' and save.  It should then automatically show up in yur Services menu.

     

    SG

  • by k8ty68,

    k8ty68 k8ty68 Mar 18, 2014 2:38 PM in response to SGIII
    Level 1 (0 points)
    Mar 18, 2014 2:38 PM in response to SGIII

    You are awesome!!! Thankyou so much!

  • by writer_in_virginia,

    writer_in_virginia writer_in_virginia Mar 26, 2014 11:36 AM in response to SGIII
    Level 1 (0 points)
    Mar 26, 2014 11:36 AM in response to SGIII

    Is there an Applescript I can use to remove duplicates in the following way -- a purge. Here is the scenario...

     

    In row B is a list of active URLS. In the next row, Row C, is a list of URLS that became inactive.

     

    How can I pass the list of Inactive URLS in Row C against the good URLS in Row B and do the following -- If an entry in the In-active URLS matches an entry in the ACTIVE URLS, delete that entry from the Actives.

     

    In other words, I need to purge the Active URLS of any that may be inactive.

     

    What script could I use to accomplish this?

     

    Thank you so much.

     

    writer_in_virginia

  • by Wayne Contello,

    Wayne Contello Wayne Contello Mar 26, 2014 11:49 AM in response to writer_in_virginia
    Level 6 (19,416 points)
    iWork
    Mar 26, 2014 11:49 AM in response to writer_in_virginia

    There is a script you can try posted by SG earlier in this same thread.  Review that and see if it helps you.  You can use the navigation arrows and numbers at the top and bottom of this thread to go to other pages in this thread:

     

    Screen Shot 2014-03-26 at 1.40.14 PM.png

     

    Of if the script does not do what you want you can do something like this:

    Screen Shot 2014-03-26 at 1.46.41 PM.png

     

    Add a new column after the list is inactive URLS (in this example, column D).

     

    D2=IF(COUNTIF($C, B2)>0, "", B2)

     

    this is shorthand for select cell D2, then type (or copy and paste from here) the formula:

    =IF(COUNTIF($C, B2)>0, "", B2)

     

    select cell D2, copy

    select column D, paste

     

    now column D ONLY contains valid URLs.  You can copy it, then select column B, then select the menu item "Edit > Paste Formula Results", now empty the inactive URL list and repeat later as needed

  • by writer_in_virginia,

    writer_in_virginia writer_in_virginia Mar 26, 2014 11:50 AM in response to Wayne Contello
    Level 1 (0 points)
    Mar 26, 2014 11:50 AM in response to Wayne Contello

    I tried to locate that script and couldn't find it. Also the last sentence of your response was cut off. It said...

     

    "Or if the script does not do what you want you can do something like this:", but there was nothing underneath that line.

  • by writer_in_virginia,

    writer_in_virginia writer_in_virginia Mar 26, 2014 11:54 AM in response to Wayne Contello
    Level 1 (0 points)
    Mar 26, 2014 11:54 AM in response to Wayne Contello

    Just saw your full suggestion come up. Will try it right now. Thanks

  • by writer_in_virginia,

    writer_in_virginia writer_in_virginia Mar 26, 2014 12:08 PM in response to Wayne Contello
    Level 1 (0 points)
    Mar 26, 2014 12:08 PM in response to Wayne Contello

    I apologize for a super-dumb question, but being a novice, I didn't know how to enter this formula in row D. I put in an equal sign and then added the formula to the whole D row, but that wasn't right. Got not result and error message. Any advice? Thank you.

  • by SGIII,

    SGIII SGIII Mar 26, 2014 12:40 PM in response to writer_in_virginia
    Level 6 (10,796 points)
    Mac OS X
    Mar 26, 2014 12:40 PM in response to writer_in_virginia

    No such thing as a super-dumb question with spreadsheets.  They can be complicated.  I think Wayne will answer on your formula entry problem.

     

    Meanwhile, here is a script you can paste into AppleScript Editor and run. It puts the results on the clipboard so you can paste the new list where you want it via command-v or Edit > Paste and Match Style. It assumes you have clicked somewhere on the table.  You can change the numbers in the "Properties" if you decide to put your lists in columns other than B and C.

     

    SG

     

     

    -- active list in one column, inactive list in another

    -- produces a new list with inactive values removed

    -- run and paste results where needed

    property colNumActive : 2 -- change if Active List in column other than B

    property colNumInactive : 3 -- change if Inactive List in column other than C

    property firstBodyRow : 2 -- change if other than 1 header row

     

    set activeList to getNonBlankColValues(colNumActive)

    set inactiveList to getNonBlankColValues(colNumInactive)

     

    --loop through activeList removing any matches with inactiveList

    set newList to {}

    repeat with i from 1 to count of activeList

              tell item i of activeList

                        if it is not in inactiveList then copy it to end of newList

              end tell

    end repeat

    set the clipboard to joinList(newList, return)

    display notification "Cleaned list ready to paste."

     

    to getNonBlankColValues(colNum)

              try

                        tell application "Numbers" to tell front document to tell active sheet to tell (first table whose class of selection range is range) to tell column colNum

                                  set colVals to {}

                                  repeat with i from firstBodyRow to count cells

                                            tell cell i

                                                      if value is not missing value then copy value to end of colVals

                                            end tell

                                  end repeat

                                  return colVals

                        end tell

              on error

                        display dialog "Having trouble. Did you select a table that has values in columns B and C?" buttons "Cancel" default button "Cancel"

                        return

              end try

    end getNonBlankColValues

     

    to joinList(aList, separator)

              set {oTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, separator}

              set listStr to aList as string

              set AppleScript's text item delimiters to oTID

              return listStr

    end joinList

     

    -- end of script

  • by Wayne Contello,

    Wayne Contello Wayne Contello Mar 26, 2014 12:55 PM in response to writer_in_virginia
    Level 6 (19,416 points)
    iWork
    Mar 26, 2014 12:55 PM in response to writer_in_virginia
    ENTERS A FORMULA IN A SINGLE CELL:

    D2=IF(COUNTIF($C, B2)>0, "", B2)

     

    <<Pay particular attention here>>

    this is shorthand for select cell D2, then type (or copy and paste from here) the formula:

    =IF(COUNTIF($C, B2)>0, "", B2)

     

    NOW DUPLICATE THE FORMULA IN THE WHOLE COLUMN

    select cell D2, copy

    select column D, paste

     

    FINALLY, REPLACE THE ORIGNAL LIST WITH ONLY ACTIVE URLS:

    now column D ONLY contains valid URLs.  You can copy it, then select column B, then select the menu item "Edit > Paste Formula Results", now empty the inactive URL list and repeat later as needed

  • by writer_in_virginia,

    writer_in_virginia writer_in_virginia Mar 26, 2014 2:38 PM in response to SGIII
    Level 1 (0 points)
    Mar 26, 2014 2:38 PM in response to SGIII

    This script is magic. Seems like it anyway. Thank you so much! Now I have to go to Wayne's method and master that too.

     

    Thank you both for sharing your abilities.

  • by writer_in_virginia,

    writer_in_virginia writer_in_virginia Mar 26, 2014 2:51 PM in response to Wayne Contello
    Level 1 (0 points)
    Mar 26, 2014 2:51 PM in response to Wayne Contello

    When I start by entering the formula =IF(COUNTIF($C, B2)>0, "", B2) in cell D2, it then says (after clicking on the green check mark), "This formula contains a syntax error."

     

    Am trying to follow your instructions to the letter, so I don't know where I got it wrong.

     

    I understand your instruction:

    NOW DUPLICATE THE FORMULA IN THE WHOLE COLUMN

    select cell D2, copy

    select column D, paste

     

    It's just the first step before that which I'm not getting right.

  • by Wayne Contello,

    Wayne Contello Wayne Contello Mar 26, 2014 3:05 PM in response to writer_in_virginia
    Level 6 (19,416 points)
    iWork
    Mar 26, 2014 3:05 PM in response to writer_in_virginia

    Writer,

     

    Here is how the formula looks in a cell on my computer:

    Screen Shot 2014-03-26 at 5.03.56 PM.png

     

    Here is what you posted:

    =IF(COUNTIF($C, B2)>0, "", B2)

     

    Here is what I suggested you type:

    =IF(COUNTIF($C, B2)>0, "", B2)

     

    I do not see any difference.  Can you, please, post a screenshot?  Here's how:

    https://discussions.apple.com/docs/DOC-6591

  • by writer_in_virginia,

    writer_in_virginia writer_in_virginia Mar 26, 2014 3:16 PM in response to Wayne Contello
    Level 1 (0 points)
    Mar 26, 2014 3:16 PM in response to Wayne Contello

    Here's the screenshot.

    Screen Shot 2014-03-26 at 6.11.27 PM.png

  • by Wayne Contello,

    Wayne Contello Wayne Contello Mar 26, 2014 3:20 PM in response to writer_in_virginia
    Level 6 (19,416 points)
    iWork
    Mar 26, 2014 3:20 PM in response to writer_in_virginia

    you have an extra "=" sign

first Previous Page 3 of 5 last Next