+ Reply to Thread
Results 1 to 6 of 6

Picking data out of different columns

  1. #1
    Valued Forum Contributor
    Join Date
    02-09-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 2016
    Posts
    1,075

    Picking data out of different columns

    The purpose of the attached workbook is to calculate the average number of days a customer takes to pay their invoices. There are two tabs - Invoices and Payments. I am trying to calculate the number of days between Invoices "Sales Date" and Payments "Settlement Date".

    The Payments tab is raw data exported from Attache financial system as CSV. It is the best I can get out of the system but the columns are all over the place.

    I thought maybe from the Invoices tab I could search a row on the Payments tab to match the invoice number, find the cell containing the phrase "Invoice Number" then pick up the date from the following cell which contains the Settlement Date . This would be straight forward if the data from the CSV file consistently landed in the same column in the Payments worksheet, but it doesn't. As you can see, the phrase "Invoice Number" might appear in any one of several different columns.

    I would be most grateful if anyone suggest a method for this lookup please.
    Attached Files Attached Files
    Trish in Oz
    -------------
    A problem well defined is a puzzle half solved


    If you attach a sample of your workbook it will be easier to find a solution. Remember to remove/replace sensitive data before uploading the file. Look here if you need help with attachments:
    http://www.excelforum.com/faq.php?fa...b3_attachments

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Picking data out of different columns

    Try in L8:
    Please Login or Register  to view this content.
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Quang PT

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Picking data out of different columns

    Maybe a UDF:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by protonLeah; 04-03-2014 at 01:43 AM.
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    03-30-2014
    Location
    Suzhou,China
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Picking data out of different columns

    There is also a LOOKUP solution than does not require Ctrl+Shift+Enter:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Welcome to China,Welcome to Suzhou...And,我是来学英文的。

  5. #5
    Valued Forum Contributor
    Join Date
    02-09-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 2016
    Posts
    1,075

    Re: Picking data out of different columns

    Thanks everyone for your input.

    wcymiss - I must be missing something but your formula returns the same data regardless of the invoice number in column A.

    bebo - thanks for your formula - it works well but only returns data if the invoice number is in column D. Is it possible to make it look at the entire worksheet and return the data from columns E:R also?

    Protonleah - thanks very much for your sample workbook. It looked amazing when I first opened it but when I try to save it or edit it the formulas all return a #VALUE error. I do not know anything about UDFs so I can't fix it myself. Are you able to suggest a solution to this problem please?

  6. #6
    Valued Forum Contributor
    Join Date
    02-09-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 2016
    Posts
    1,075

    Re: Picking data out of different columns

    #VALUE problem solved itself!!! protonLeah your UDF works exactly as I need it to and I have managed to copy it into my real reporting workbook with just under 14,000 rows and it still works. Thank you soooo much.

+ 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. Picking values from two columns whose data match
    By devavratha in forum Excel General
    Replies: 2
    Last Post: 08-23-2012, 05:53 AM
  2. How to get a Combobox to show two columns after picking value ?
    By Petter120 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-24-2012, 03:19 AM
  3. Picking two columns of data and combining
    By khank in forum Excel General
    Replies: 12
    Last Post: 01-14-2011, 05:30 PM
  4. Picking out data and combining it from 2 columns
    By hokeyplyr48 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-01-2008, 12:40 PM
  5. picking out odd and even columns
    By censura in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-19-2007, 03:22 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