+ Reply to Thread
Results 1 to 6 of 6

Selectively transposing data from a downloaded csv file to populate an existing table.

  1. #1
    Registered User
    Join Date
    10-11-2011
    Location
    Pittsboro, NC
    MS-Off Ver
    Excel 2013
    Posts
    11

    Selectively transposing data from a downloaded csv file to populate an existing table.

    I have a rates/rebates feed, downloaded daily (sometimes more than once) as a .csv file.
    The feed is delivered as a vertical listing (see example in attached file) that needs to be transposed to a horizontal format (also illustrated) for use with an existing spreadsheet application.

    The selective part comes from the fact only certain products are required and only the rebates for the specific rates identified in the spreadsheet table.

    I have tried various combinations of Vlookup, Hlookup, Index,Match,Match, and Offset, all unsuccessfully so far.
    Index, Match, Match looked most promising but only got me part of the way.

    Any ideas?
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Selectively transposing data from a downloaded csv file to populate an existing table.

    Hi,

    Does the attached help. I've used a helper column F and then a formula in K21 copied to Q21. Ditto in K24
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    These are examples. I can't see where you get the -.75 in Q8. Perhaps you could clarify. Note that this solution requires the same Product Description from column C in column I. i.e. 30yr not 30 Year

    However you imply that this table is an intermediate table in order to provide data for another workbook. Can I suggest that you just link the other workbook directly to your csv feed and avoid the intermediate step. I'd also consider using a Pivot Table thereby avoiding the need for any functions whatosever. This would be far more elegant and efficient.
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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

    Re: Selectively transposing data from a downloaded csv file to populate an existing table.

    Hi watkincm,

    This looks like you need to do a pretty simple (for me at least) Pivot Table with your data. See the attached..
    Sample rates table PT conversion.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,361

    Re: Selectively transposing data from a downloaded csv file to populate an existing table.

    I copied columns G & H to A & B of Sheet2

    in C1

    =IFERROR(INDEX(Sheet1!$D$4:$D$1000,MATCH(Sheet2!$A2,Sheet1!$B$4:$B$1000,0)+COUNTIF(Sheet1!$B$4:$B$1000,Sheet2!$A2)-COLUMNS($A:A)),"")

    In C2

    =IFERROR(INDEX(Sheet1!$E$4:$E$1000,MATCH(Sheet2!$A2,Sheet1!$B$4:$B$1000,0)+COUNTIF(Sheet1!$B$4:$B$1000,Sheet2!$A2)-COLUMNS($A:A)),"")

    Copy both across columns until you get blank

    Copy both rows to C4 , C7 etc
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-11-2011
    Location
    Pittsboro, NC
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Selectively transposing data from a downloaded csv file to populate an existing table.

    Thanks Richard.
    The Pivot Table turned out to be the simplest answer and it works well with the daily rates feed.
    Ever come across a situation where formulae just don't work when they should?
    Nothing worked properly until I accidentally deleted some of the original rates table and had to re-key it.
    Suddenly everything started to work - go figure!

  6. #6
    Registered User
    Join Date
    10-11-2011
    Location
    Pittsboro, NC
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Selectively transposing data from a downloaded csv file to populate an existing table.

    It's been so long since I used a Pivot Table, I'd forgotten they existed.
    Turned out to be the simplest solution and works well in a daily feed scenario.
    Thanks

+ 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. [SOLVED] How to populate the data accordingly into a table with fixed header from raw file?
    By Shermaine2010 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-13-2015, 11:28 AM
  2. Programme to turn downloaded data into a form that's recognised by pivot table
    By suesein in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-23-2014, 03:49 AM
  3. Macro to selectively output the data to another table
    By ningtong88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-04-2012, 05:06 AM
  4. Excel 2007 : help with matching downloaded file to a table
    By catherine3 in forum Excel General
    Replies: 0
    Last Post: 11-01-2011, 02:13 PM
  5. Selectively transferring data from a text file
    By jp001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2009, 09:33 AM
  6. Replies: 2
    Last Post: 08-06-2008, 12:13 PM
  7. Selectively Populate Excel VBA Combo Box
    By ll in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-04-2006, 05:20 PM

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