+ Reply to Thread
Results 1 to 5 of 5

Importing data to new column, with cell contents filled based on existing column data

  1. #1
    Registered User
    Join Date
    12-02-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2016, I think....
    Posts
    3

    Importing data to new column, with cell contents filled based on existing column data

    Sorry if my title is a bad description - I'm finding it hard to briefly explain what I am trying to achieve (which isn't helping me search for useful terms).
    Attached is a small example spreadsheet with my two existing sheets, and what I would like to achieve.

    I have data in one sheet which has two relevant identifiers ('ID' and 'ScientificName' - these are consistent and linked). Each ID/ScientifiName might have several Threat Codes, so can appear in multiple rows in this sheet.

    I want to add the 'Assessment' data from a different sheet - here each ID/ScientificName appears only once.

    Can I pull in the 'Assessment' data and somehow link it to either 'ID' or 'ScientificName' so that the correct 'Assessment' data will appear in a new column, including the repeats where they occur...?

    Thanks in advance for any help with this! Even any help on what terms might be useful for me to search would be appreciated!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Importing data to new column, with cell contents filled based on existing column data

    In D2, you can copy this formula and then copy it down the list:

    =INDEX(Assessment!$C$2:$C$5,MATCH(ThreatCode!A2,Assessment!$A$2:$A$5,0))

  3. #3
    Registered User
    Join Date
    12-02-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2016, I think....
    Posts
    3

    Re: Importing data to new column, with cell contents filled based on existing column data

    Thank you, that's perfect - I knew there would be a way!!

  4. #4
    Registered User
    Join Date
    12-02-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2016, I think....
    Posts
    3

    Re: Importing data to new column, with cell contents filled based on existing column data

    Hi - I have an updated issue to tag onto this question. I've been trying to work out why in some cases I was getting unexpected errors (#N/A) when I realised that when I had copied the formula down the column, it had changed the index and match ranges so that the item being searched for was no longer within the prescribed search range.

    E.g. =INDEX(ASSESSMENT!D2:D6772, MATCH(C2,ASSESSMENT!C2:C6772,0))

    Became =INDEX(ASSESSMENT!D3:D6773, MATCH(C3,ASSESSMENT!C3:C6773,0)) when I copied it down.

    I do want the 'C2' to change to 'C3' in the first part of MATCH, but I don't want the given ranges for INDEX or MATCH (the bits in bold above) to change - I want these to be the same all the way down the column.

    Is there a quick fix for this? I hope so because copy-paste down >4000 rows is going to take me a while!!


    EDITED TO ADD: I worked it out - simply using the $ to fix column and row references for those ranges!
    Last edited by swren; 12-09-2019 at 07:23 PM. Reason: Worked out the answer!!

  5. #5
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Importing data to new column, with cell contents filled based on existing column data

    Hence, why the formula given in Post #2 HAD the $ signs already in it

+ 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. Fill Down Data Based on Contents of Another Column
    By excel6000 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-17-2014, 02:50 PM
  2. [SOLVED] Column O and Column P shall filled if there are contents in Column A before Close
    By wunderbartina in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2014, 06:09 AM
  3. Macro to enter data in next column if previous column is filled.
    By NIKNIKNIK in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-15-2014, 11:26 AM
  4. Clear Contents of column based on data in another column
    By wachao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2014, 02:39 AM
  5. [SOLVED] stream gage data need a seasonal column filled based on the date (macro)
    By shivernoz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-15-2014, 03:06 PM
  6. Formula/macro to edit cells in one column based on contents of a cell in another column
    By robbyvegas in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-25-2012, 06:10 AM
  7. VBA Code to copy data from last filled column and paste to the next available column.
    By Pavman2473 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2012, 09:07 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