+ Reply to Thread
Results 1 to 9 of 9

Inserting text to cells based on conditional formatting

  1. #1
    Registered User
    Join Date
    06-30-2021
    Location
    Dallas, Texas
    MS-Off Ver
    16
    Posts
    5

    Inserting text to cells based on conditional formatting

    I want to add a list of words in the part of the column under "IRU" (located in H216), as shown here:
    iru.png

    If cells B20-B131 contain "IRU" (with exact capitalization), I want to add the word from the adjacent cell to the list. For example, given that cell B124 (highlighted in green) contains "IRU": cell.png, I want to add the value in cell A124 (polyester): A.png to a cell under IRU as shown earlier. What formula can I use to accomplish this?

    Edit: also attached is the excel sheet.
    Attached Files Attached Files
    Last edited by mhanna112; 07-05-2021 at 02:20 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: Inserting text to cells based on conditional formatting

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

    I suppose that you have IRU text in C1
    Diana Tanase


    If the solutions offered helped you to solve your problem, then mark the thread as SOLVED (thread tools in the top menu) and you can click on * to add reputation to those who helped you, as a way to say thank you !

  3. #3
    Registered User
    Join Date
    06-30-2021
    Location
    Dallas, Texas
    MS-Off Ver
    16
    Posts
    5

    Re: Inserting text to cells based on conditional formatting

    This only works for the first match. Can I alter the formula to retrieve all matches, rather than just one?

  4. #4
    Registered User
    Join Date
    06-30-2021
    Location
    Dallas, Texas
    MS-Off Ver
    16
    Posts
    5

    Re: Inserting text to cells based on conditional formatting

    Quote Originally Posted by tanasedn View Post
    Try this formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I suppose that you have IRU text in C1
    This only works for the first match. Can I alter the formula to retrieve all matches, rather than just one?

  5. #5
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: Inserting text to cells based on conditional formatting

    Quote Originally Posted by mhanna112 View Post
    This only works for the first match. Can I alter the formula to retrieve all matches, rather than just one?
    In this particular case, without VBA, in column C in first cell type the word you want("IRU") and in C2 insert the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And then sort by this column. The cells with values will appear at top and they are associated with text in column B that contain "IRA"
    Otherwise, if you need the values to be extracted in other worksheet than, is better to use VBA!

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Inserting text to cells based on conditional formatting

    I suggest that you upload a sample WB - see the yellow banner above to see how to
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    06-30-2021
    Location
    Dallas, Texas
    MS-Off Ver
    16
    Posts
    5

    Re: Inserting text to cells based on conditional formatting

    Quote Originally Posted by FDibbins View Post
    I suggest that you upload a sample WB - see the yellow banner above to see how to
    Thank you. I just updated!

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,382

    Re: Inserting text to cells based on conditional formatting

    There are no manually added expected results in your sample file, so it remains as clear as mud (to me).
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    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,005

    Re: Inserting text to cells based on conditional formatting

    In H217

    =IFERROR(INDEX($A$2:$A$131,AGGREGATE(15,6,(ROW($A$2:$A$131)-1)/(FIND("IRU",$B$2:$B$131)>0),ROWS($1:1))),"")

    Copy down
    Last edited by JohnTopley; 07-05-2021 at 05:44 AM.

+ 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. 2 conditioal outputin 1 column based on max values
    By pmbhome in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-21-2021, 06:23 AM
  2. conditional formatting fill cells based on text, how to find sum based on CF colour
    By tubbybear in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-27-2016, 12:04 PM
  3. [SOLVED] Formatting a cell with a colour based on text in other cells.
    By Borneorose in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-02-2013, 08:24 AM
  4. Replies: 1
    Last Post: 04-19-2013, 09:47 AM
  5. Conditional Formatting based on text in previous cells
    By avidcat in forum Excel General
    Replies: 3
    Last Post: 07-14-2012, 01:01 PM
  6. VBA code for inserting formula, based on another cells text value.
    By Pancho3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2011, 04:30 PM
  7. Conditioal formatting problem
    By HDV in forum Excel General
    Replies: 3
    Last Post: 09-22-2005, 10:05 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