+ Reply to Thread
Results 1 to 3 of 3

compare multiple numbers in two columns

  1. #1
    Registered User
    Join Date
    09-01-2010
    Location
    Warrenton, NC
    MS-Off Ver
    Office 365
    Posts
    6

    Question compare multiple numbers in two columns

    I have an excel table that has a date, Name, ID#, Check In Item, Check Out Item, and Comments. The two columns I am concerned about are the Check in and Check out columns. They contain the ID numbers for Books, Videos, or CDs checked out or in from our Library. They can contain numbers ranging from an empty cell to 50 numbers in a cell. What I need to do is Check the numbers in the Check Out column and compare them with numbers in the Check in column in every row. I am trying to determine if any books in the Check out section have been checked In. I would need to go through each row to see if the Check out column has data in it. If it does then I need to go through all the rows to find the check in column that has data in it and check it to see if it has numbers that match with the check out. If it does than I will have to check the dates of the Check In and Check out to see if the Check In date is greater than the Check out Date. If it is then the item has been checked in otherwise its still check out.

    An example of the number in check in would be a cell that contain "23457 63478 5890" each item is separated by a space. The same is true with the check out item. Howe ver the number of items in the cell will very as to whether an item was checked in or out and how many were checked in or out. I have gotten as far as being able to go through each cell and split the items in to an array and then use a for each command to get the items from the array but I haven't been able to come up with the correct logic to get data from the Check out column and compare it to the items in all the rows in the Check in column. If anyone thinks they can help me, I will be glad to send a copy of the data and the macro for it.

    Thanks
    Patrick

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: compare multiple numbers in two columns

    Hi,

    Thinking about this problem, it might be easier if you created a table that had:
    Date, Name, ID#, Item Number, In/Out

    You would need to separate all the In and Out Items into a single row per item. Then I think this problem becomes a lot easier.

    You can attach a sample by doing...


    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: compare multiple numbers in two columns

    As soon as you have something like "23457 63478 5890" in a cell, that is no longer 3 numbers, it is a text string. I was thinking of using MATCH to find what you want, however, I think it would be far better to break out each number into it's own row (pretty much what Marvin suggested, I think). That way, you can search for a specific number and return that row, if needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. VBA Code to compare/match multiple columns in one sheet with multiple columns in another
    By cellsearch123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2016, 09:25 AM
  2. Compare numbers in two columns
    By NormanB in forum Excel General
    Replies: 4
    Last Post: 09-13-2013, 02:38 PM
  3. [SOLVED] Compare number from cell to numbers in columns A in 2 sheets
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 05:27 PM
  4. Compare numbers in two columns in two diffirent sheets
    By Korven in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-15-2012, 01:43 AM
  5. How do I compare tow columns of numbers?
    By ken0860 in forum Excel General
    Replies: 1
    Last Post: 06-13-2006, 04:18 PM
  6. Compare text/numbers in different columns.
    By Mike in forum Excel General
    Replies: 1
    Last Post: 02-07-2006, 03:25 PM
  7. [SOLVED] How do I compare two Excel columns of numbers and see non-matches
    By Tcom in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-07-2005, 05:25 PM

Tags for this Thread

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