+ Reply to Thread
Results 1 to 9 of 9

Formula to copy and paste if referenced cell has extended value (more than one word)

  1. #1
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    116

    Formula to copy and paste if referenced cell has extended value (more than one word)

    Hi All,
    This is related to my last post for a formula to copy and paste if referenced cell has specific value, and because that was successfully answered I closed it.
    Here is my original thread:
    I have a long list of data with specific values listed in Column A. I need a formula to be used on a separate tab, that will go down the list of the referenced tab, and referenced column/cell, and return the whole row if a specific text is in that referenced column/cell. If there the referenced cell is blank then it should return a blank, and not show the formula or “0”, “value”, etc. Unfortunately the formula I’m using (below) is returning the data in cell A2 (Row 1 is the column headers).
    =IFERROR(INDEX('Produce'!A$2:A$250,SMALL(IF('Produce'!$A$2:$A$250="Apples",ROW('Produce'!$A$2:$A$250)-1),ROWS($A$1:A1))),"")


    One solution was =IFERROR(INDEX(Produce!A$1:A$250,SMALL(IF(Produce!$A$1:$A$250="Apples",ROW(Produce!A$1:A$250)),ROW(A1))),"")
    Control+Shift+Enter.

    However, I do need an extension to that formula. I have two or more word products – “Strawberries – Organic”, “Seedless Grapes (Purple)”, “Seedless Grapes (Green), etc., and the formula returns only the first word, and the remaining columns i.e. B2:F2 are blank.

    Any suggestions?

    SP

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Formula to copy and paste if referenced cell has extended value (more than one word)

    Are you able to post a small sample workbook (Use: Go Advanced > Manage Attachments) so we can get a better sense of what your issue looks like?

  3. #3
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    116

    Re: Formula to copy and paste if referenced cell has extended value (more than one word)

    Mais oui bien sûr

    and thank you!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Formula to copy and paste if referenced cell has extended value (more than one word)

    I'm not sure I'm fully understanding what you're after. The formula from your initial solution can be adjusted to accommodate new (and multi-word) produce types on separate sheets (see attached). e.g.:

    =IFERROR(INDEX(Produce!A$1:A$250,SMALL(IF(Produce!$A$1:$A$250="Seedless Grapes",ROW(Produce!A$1:A$250)),ROW(A1))),"")

    Is the issue that you're looking to combine types? Should “Seedless Grapes (Purple)” and “Seedless Grapes (Green)" be on the same sheet?
    Attached Files Attached Files

  5. #5
    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,206

    Re: Formula to copy and paste if referenced cell has extended value (more than one word)

    Not clear (to me) exactly what you want ..

    =IFERROR(INDEX(Produce!A$1:A$250,SMALL(IF(ISNUMBER(SEARCH("Strawberries",Produce!$A$1:$A$250)),ROW(Produce!A$1:A$250)-ROW(Produce!$A$1)+1,""),ROWS($A$1:A1))),"")

    Enter with Ctrl+Shift+Enter

    copy across and down

    will return any text containing "Strawberries".

  6. #6
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Formula to copy and paste if referenced cell has extended value (more than one word)

    Hi
    Try this formula as a helper column in Sheet 'Apples' (Column I where I1 is Apples) and copy down

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In same Sheet use in A2 and copy down and right
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note: You do not need Produce!H1:O29
    Do the same for the other products
    See the file
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    116

    Re: Formula to copy and paste if referenced cell has extended value (more than one word)

    Hi All,
    My apologies for the unclear thread.
    Thank you to all for responding so quickly.

    What I needed was a return of the whole row if a particular word was in the formula. I did not want to copy the entire set of words as some product names are rather long, as well as I can keep some similar products in the same worksheet.

    I have used all three formulae – albeit in different workbooks, and watching the magic work is so satisfying. These have saved me a whole lot of extra work! Merci!

    I will close the thread for now.

  8. #8
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Formula to copy and paste if referenced cell has extended value (more than one word)

    For what it's worth, you can modify the strategy proposed by JohnTopley and me above with the following formula:

    =IFERROR(INDEX(Produce!C$1:C$250,SMALL(IF(ISNUMBER(SEARCH("Strawberries",Produce!$A$1:$A$250)),ROW(Produce!C$1:C$250)),ROW(C7))),"")

    To return all matches that CONTAIN "strawberries", instead of just exact matches (e.g. it would include "strawberries organic" from your sample)

  9. #9
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    116

    Re: Formula to copy and paste if referenced cell has extended value (more than one word)

    This is exactly what I wanted! Thank you Cantosh.
    I have a new need related to this and regarding dates. However, in keeping with Forum rules, I will create a new post. Please stay tuned. Merci.

+ 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] Formula to copy and paste if referenced cell has specifc value
    By stpeter in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-03-2016, 01:13 PM
  2. Replies: 1
    Last Post: 03-14-2016, 09:26 PM
  3. [SOLVED] Macro to find specific word in cell and then copy and paste the adjacent cell upwards
    By raytej82 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-04-2014, 05:33 PM
  4. Replies: 8
    Last Post: 11-04-2013, 02:34 PM
  5. Replies: 1
    Last Post: 02-18-2013, 11:36 AM
  6. Copy and Paste from Word to Excel Cell
    By Gos-C in forum Excel General
    Replies: 5
    Last Post: 11-04-2008, 03:07 PM
  7. copy a list of items from word and paste in cell
    By Priscilla in forum Excel General
    Replies: 1
    Last Post: 11-11-2005, 02:51 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