+ Reply to Thread
Results 1 to 9 of 9

Returning value from a third column; based on two other columns.

  1. #1
    Registered User
    Join Date
    06-24-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Returning value from a third column; based on two other columns.

    Hi everyone

    First post here but this a problem that I'm not really sure how to go about solving. Basically; picture having three columns with data as shown below:
    The actual data is thousands of line; with an order number listed for each task name; and each task has a sign off date.
    OrderNumber TaskName SignOffDate
    1 a 01/05/2012
    1 b 17/05/2012
    1 c 22/05/2012
    1 d 02/06/2012
    2 a 03/05/2012
    2 b 19/05/2012
    2 c 27/05/2012
    2 d 02/06/2012

    What I am trying to do; is sort this data in a second worksheet so that the sign off dates for each task; for each order; are listed within 1 single row. Ie:

    OrderNumber a b c d
    1 01/05/2012 17/05/2012 22/05/2012 02/06/2012
    2 03/05/2012 19/05/2012 27/05/2012 02/06/2012

    There are many orders in the main data; and I'm not sure what to do exactly to return the sign off dates for each task for each order without creating separate worksheets for each task name; then using vlookups to find each date.

    Any help would be most welcome!

    I've attached dummy data in a spreadsheet if it helps!

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Returning value from a third column; based on two other columns.

    Hi
    does every order always have 4 tasks in the same order (OEN, CTN, etc)?
    if so, and the sheet names are the same as in your sheet, try running this macro
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-24-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Returning value from a third column; based on two other columns.

    Thanks for the reply NickyC!

    I will try the macro you posted and report back; however each order may not have all 4 task names. Ie. Some may ahve OED, CTN, FAD6, and RFS; whilst some may only have one or two of those. As for the ordering; they should always appear in the same order. However; say they did not; how would the macro above change?

    Thanks

    Tony

  4. #4
    Registered User
    Join Date
    06-24-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Returning value from a third column; based on two other columns.

    Tried the macro and it did not return the dates unfortunately; it returned the order numbers instead

  5. #5
    Registered User
    Join Date
    06-24-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Returning value from a third column; based on two other columns.

    Got it working; just modified your macro very slightly and used DestColNum = 2 instead of 1.

    Thanks again!

  6. #6
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Returning value from a third column; based on two other columns.

    Hi
    that might not work completely - try this
    if they do not have all four task names, do they still have that row in the source sheet with a blank against the value instead of a date, or are there fewer rows?

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-24-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Returning value from a third column; based on two other columns.

    If they do not have a task name, there would be fewer rows in the source sheet

  8. #8
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Returning value from a third column; based on two other columns.

    ok, try this

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-24-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Returning value from a third column; based on two other columns.

    That Macro worked; tested it for data without a taskname.

    Thank you so much for your help; it is greately apprecaiated!

+ 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