+ Reply to Thread
Results 1 to 6 of 6

pulling data from cells near unique descriptor

  1. #1
    Registered User
    Join Date
    11-16-2020
    Location
    Knoxville, Tennessee
    MS-Off Ver
    Office 365 version 2010
    Posts
    7

    Arrow pulling data from cells near unique descriptor

    I have a feature list from a bacterial genome assembly that has had some nomenclature changes over the years. I am trying to create new columns using the locus_tag, old_locus_tag, gene, and product identifiers to create an easy to read table. The problem I encounter is that not every entry has a gene name, or old_locus_tag. I asked for help here previously but I did not include an example that included this problem. I have attached the old sample with the solve and a new example that provides examples of missing identifiers. Ideally I would like to leave the new cells empty if there is no gene or old_locus_tag for that entry. I cannot post a link yet, but the previous post I referred to is my only other thread.

    https://www.excelforum.com/office-36...escriptor.html
    link added by Moderator --6JS
    Attached Files Attached Files
    Last edited by 6StringJazzer; 09-08-2021 at 04:46 PM.

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

    Re: pulling data from cells near unique descriptor

    For clarity, it's always best to provide the answers that you are expecting (Mock-up the results area of what it should look like when the formulas are applied). What if there is a product, but nothing else. Do you want the product listed an nothing else in that row? The same question regarding locus_tag (or any other the other 3 for that matter)? In other words, does it need to have a locus tag before you consider listing anything else?

    ***EDIT - added ***

    Also, are the categories always listed in the same order? Meaning, is "gene" always before "locus_tag" and is that always before "old_locus_tag", etc. (I realize that they won't all be listed, but as far as those that are listed, will they always be in that order?
    Last edited by Gregb11; 09-08-2021 at 05:57 PM. Reason: adding info

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

    Re: pulling data from cells near unique descriptor

    Well, this might get the conversation started so I put together a solution with assumptions. Actually there are 2 solutions I attached. Both solutions require a couple of helper columns (to have the values in Cols C&D repeat downward. I put these in Cols F&G. Cell F2 is this:
    =IF(B2="",F1,B2)
    And similarly in G2:
    =IF(C2="",G1,C2)

    The first solutions shows the 4 elements you're wanting based on the Unique numbers in ColB, so in H2 entered:
    =FILTER(UNIQUE(B2:B30),UNIQUE(B2:B30)<>0)
    Then in I2 (for locus_tag), I entered:
    =XLOOKUP($H2&I$1,$F$2:$F$38&$D$2:$D$38,$E$2:$E$38,"")

    This formula I copied across and down as needed.

    See attached.
    (The other solution also in the attached, just assumes the Unique rows are a combination of column B and C. See this solution in columns N:S in the attached.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-16-2020
    Location
    Knoxville, Tennessee
    MS-Off Ver
    Office 365 version 2010
    Posts
    7
    Quote Originally Posted by Gregb11 View Post
    For clarity, it's always best to provide the answers that you are expecting (Mock-up the results area of what it should look like when the formulas are applied). What if there is a product, but nothing else. Do you want the product listed an nothing else in that row? The same question regarding locus_tag (or any other the other 3 for that matter)? In other words, does it need to have a locus tag before you consider listing anything else?

    ***EDIT - added ***

    Also, are the categories always listed in the same order? Meaning, is "gene" always before "locus_tag" and is that always before "old_locus_tag", etc. (I realize that they won't all be listed, but as far as those that are listed, will they always be in that order?
    Thank you for the reply. Starting off, I believe that every entry has a locus_tag because this genome assembly is based on that identifier. The order for identifiers per unique entry is always in the order shown in the example. If it is easiest to make the formula dependent upon the locus tag then I believe it should work properly.

  5. #5
    Registered User
    Join Date
    11-16-2020
    Location
    Knoxville, Tennessee
    MS-Off Ver
    Office 365 version 2010
    Posts
    7
    Quote Originally Posted by Gregb11 View Post
    Well, this might get the conversation started so I put together a solution with assumptions. Actually there are 2 solutions I attached. Both solutions require a couple of helper columns (to have the values in Cols C&D repeat downward. I put these in Cols F&G. Cell F2 is this:
    =IF(B2="",F1,B2)
    And similarly in G2:
    =IF(C2="",G1,C2)

    The first solutions shows the 4 elements you're wanting based on the Unique numbers in ColB, so in H2 entered:
    =FILTER(UNIQUE(B2:B30),UNIQUE(B2:B30)<>0)
    Then in I2 (for locus_tag), I entered:
    =XLOOKUP($H2&I$1,$F$2:$F$38&$D$2:$D$38,$E$2:$E$38,"")

    This formula I copied across and down as needed.

    See attached.
    (The other solution also in the attached, just assumes the Unique rows are a combination of column B and C. See this solution in columns N:S in the attached.
    Wow that was quick. Excel code confuses me so I will reserve my questions for until I get this formula applied to the full dataset. Thank you very much and I will update the thread soon.

  6. #6
    Registered User
    Join Date
    11-16-2020
    Location
    Knoxville, Tennessee
    MS-Off Ver
    Office 365 version 2010
    Posts
    7

    Re: pulling data from cells near unique descriptor

    This did the trick. Thank you so much for solving this for me.

+ 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] Pull data from cells next to descriptor
    By wbrewer5 in forum Office 365
    Replies: 6
    Last Post: 09-08-2021, 04:49 PM
  2. Replies: 1
    Last Post: 09-28-2017, 12:53 AM
  3. Replies: 2
    Last Post: 08-14-2015, 03:06 PM
  4. Pulling Unique Data from named ranges
    By Cavinaar in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-23-2013, 02:24 PM
  5. Data Validation List with a Mouse over Descriptor
    By jsmith2043 in forum Excel General
    Replies: 2
    Last Post: 09-24-2013, 01:34 PM
  6. Pulling unique data from a list
    By boll55 in forum Excel General
    Replies: 1
    Last Post: 04-15-2013, 11:45 AM
  7. Pulling Unique Data from a List
    By sabunabu in forum Excel General
    Replies: 2
    Last Post: 10-29-2007, 05:13 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