+ Reply to Thread
Results 1 to 15 of 15

Find characters in cells and return specified text

Hybrid View

  1. #1
    Registered User
    Join Date
    07-29-2022
    Location
    Manchester, England
    MS-Off Ver
    Version 2206
    Posts
    8

    Find characters in cells and return specified text

    Hi all,

    Amateur here.

    I want to search cells for specific character combinations and return either "Knitted" or "Woven" depending on what they are.

    DK, TK = Knitted

    DW, TW, BW, SW = Woven

    I've tried quite a few =IF formula combinations along with string formulas but to no avail.

    Below is some sample data, I'm unable to add and attachment for some reason, sorry!

    If anyone can give some advise it would be much appreciated!

    Thanks!

    SS18DS76BK0001
    SA18DS28GNBK04
    SA18DS78BEWE01
    SA18TP30MI0001
    SS19JY92BK0001
    SS19JY74BK0001
    SS19OR01IN002W
    SS19DS52IO0005
    S19JY121WE0001
    S19JY123BK0001
    SS19JT77BK0001
    A19DJ032MI0001
    A19OD004IO003W
    S20BD004BE0010
    S20BD002BE0010
    S20TK216PK0014
    S20BD002WE0001
    SS19OR01WE0001
    S20DW277NL0006
    S20TW078MI0001
    S20TW137BE0027
    S20DW348MI0001
    S20DW341RD0017
    S20DD050GN0031
    S20DJ076RDWE01
    S20DW225RD0017
    S20BD015BE0027
    S20DD050DM001W
    S19DS616BKRD01
    S20DW500BN0004
    S21TK356BE0001
    S21TK396BE0003
    S21TK369GN0016
    S20BW023NL0003
    S21FW021MC0003
    S21TK350MC0012
    S21TK121NL0006
    S21TW067GN0002
    S21TW113WE0001
    A20TK065NL0003
    S21DJ179PT0001
    S21TJ131BK0001
    S20DW399NL0003
    S21TW070BE0027
    S21TK401PK0014
    S21TW115WE0001
    S21DJ134WE0001
    S20DJ242BE0003
    S21TJ151BE0027
    S21TJ134RD0017
    S21DJ092BK0001
    S21TJ163WE0001
    S21TJ197NL0006
    S21TJ217NL0006
    S21TW166MC0006
    S20BD002ST0001
    S21DD035IN001W
    S21DW206NL0006
    S21TK106BE0010
    S21BD501BE0010
    S21TJ188BK0001
    S21TJ206RD0022
    SS19DM20GN0031
    A20BD095IO0005
    S21DD405GY0003
    S21BW023MI0001
    S20BD008EU0001
    S21OW095NL0006
    S21TK106MC0017
    S21DJ149MI0001
    S21DW189BE0027
    S21TW141MI0001
    S21DW187WE0001
    S21TW090GN0016
    S21DW212PK0013
    S21DW224RD0017
    S21TW185RD0017
    S21DJ147BE0003
    S21DJ148RD0016
    S20TK227MC0003
    S21TJ211GN0009
    S21AC022MI0001
    S21TJ239NAST01
    S21OW004BK0001
    S20TK228BE0002
    S20TK216BE0002
    S21JJ019RD0016
    A21AC005BN0007
    S21TJ175RD0022
    S19DS400BK0001
    S21TK109PK0014
    S21LW073BK0001
    SS19DS52WE0001
    S21TJ210WE0001
    S21TJ227BK0001
    S21DW219BE0003
    S21TJ161BE0027
    S21DJ223BK0001
    S21JJ021BE0003
    S21DJ207GY0001
    S21TJ232BK0001
    S21TJ211BK0001
    S21DW217BN0004
    S20BD002PK0004
    S20BD002GN0005
    S21TJ126BKWE01
    S20DD049DM001W
    S21OW007BK0001
    S21DJ208WE0001
    S20BD004WE0001
    S21DJ127BE0003
    S20DJ163RD0017
    S21TW087RD0037
    S21TW190PT0001
    S21TW181RD0016
    S21DW221RD0017
    S21LW085BE0021
    S21LW089BE0021
    S21JJ011BN0011
    S21BD004DM001W
    A20BJ004BE0003
    S21JW003RD0017
    S21TK350PK0004
    S21SD001BE0010
    S21BD019BE0010
    S21BD200BE0010
    S21BD800BE0010
    S21TW157BN0004
    S21JW001RD0017
    A20BD095WE0001
    A20BD095DM001W
    S21TJ166RD0037
    S21TK230PK0014
    S21DW226GN0016
    S21BW022RD0017
    S21BW008BK0001
    S21TW151YW0003
    S21TW159BE0027
    S21DW177RD0017
    S20DW312BE0027
    S21TW137NL0006
    S21LW030BE0005
    S21JJ020BE0027
    S21BJ005BE0003
    S21JJ012BK0001
    S21JJ017MI0001
    S21BJ006RD0016
    S21BJ008BE0027
    A20LW042GN0005
    S21AW013RD0016
    S21DD406IO001W
    S21LW090NL0006
    S19JY123ST0001
    A20LW007BE0027
    A20LW010BE0027
    S21TJ206BE0002
    S21TJ206GN0028
    S21TJ206BN0003
    S21TJ219BK0001
    S21DJ139PT0001
    SS19ST40WE0001
    S21DJ199BE0003
    S21DW174BE0003
    S21LW072BK0001
    S21TW127BK0001
    S21TW150RD0017
    S21TJ143GY004M
    S21DD024BE0010
    S21BJ010MI0001
    S21BK408BE0024
    S21TJ203NL0001
    S21TW091PT0004
    S21DW204BK0001
    S21TW126PT0009
    S21TJ201BK0001
    S21DW088GN0002
    A19DD012EU0001
    S21BW006GN0002
    S21TJ214BK0001
    S21TK451PK0001
    S21RW010MI0001
    A19DP006BE0040
    S21TW101MI0001
    S21TW102NL0003
    A20TJ026NL0006
    S21TW168NL0014
    S21TJ218BE0027
    S21TJ142GN0002
    S21TJ122PK0014
    S21DW104PT0001
    S21DW122PT0001
    S21TJ086BE0028
    S21AW063MI0001
    S21AW064MI0001
    A19BD004DM001W
    S20TJ211PK0014
    S21DW103BK0001
    S21LW052BK0001
    S21TK109RD0001
    S21TK358BEWE01
    A20TK001GY0002
    S21DW090NL0006
    S21DW159BE0040
    S21DW162WE0001
    S21DJ191MI0001
    S21TW109RD0017
    S21BD016GY0001
    S21BD016BE0010
    S21AW055MI0001
    S21AW058MI0001
    S21AW056MI0001
    A20DJ067MI0001
    A20TJ033BE0027
    SS19DS06NL0008
    S21TK450BE0003
    S21FW040BN0003
    S21FW039BK0001
    S21FW042MC0017
    S21FW043BK0001
    S21FW044BN0003
    S21TJ194MI0001
    S21TK108GY0002
    S21TJ086BK0001
    S21TJ086WE0001
    S21DJ176BE0003
    S21BD016BK0001
    S21DW092BE0040
    S21OW006GN0002
    S21DJ118BK0001
    S21DJ132BK0001
    S21LW054GY001M
    S21BW003BK0001
    S21AW028GY0001
    S21BD016IO003W
    S21FW022BN0007
    S21FW025MC0004
    S21FW026RD0001
    S21BW002GN0002
    S21BJ001GY0001
    A20LW042GY004M
    A20BJ004BK0001
    S21FW017BN0003
    S20TK140RD0016
    S21OL004BK0001

  2. #2
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Find characters in cells and return specified text

    I don't understand your question.
    Please can you give some examples of the desired results and, if necessary, explain the outcome?

  3. #3
    Registered User
    Join Date
    07-27-2022
    Location
    Alabama
    MS-Off Ver
    2019
    Posts
    5

    Re: Find characters in cells and return specified text

    I believe they are looking for a formula to look for those five combinations and return a certain response depending on the presence of those combinations. DK, TK = Knitted

    DW, TW, BW, SW = Woven. They need a formula to inspect the contents of a cell, determine which of those combinations are present, and return the appropriate response.

  4. #4
    Registered User
    Join Date
    07-29-2022
    Location
    Manchester, England
    MS-Off Ver
    Version 2206
    Posts
    8

    Re: Find characters in cells and return specified text

    Here's the attachment I've put a couple of examples in italics. There aren't any formula's there, that's what I'm looking for!

    So, if a cell in column a contains the letter combinations found in my OP the text to return in column B must be either Knitted or Woven.

    Hopefully that's a little clearer.

    Cheers,
    Jake
    Attached Files Attached Files
    Last edited by jakemoggy77; 08-03-2022 at 08:15 AM. Reason: Adding attachment

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find characters in cells and return specified text

    HOW TO ATTACH YOUR SAMPLE WORKBOOK:

    Fast answers need clear examples. Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.
    + Reply to ThreadResults 1 to 2 of 2
    Find characte
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,788

    Re: Find characters in cells and return specified text

    How about
    Formula: copy to clipboard
    =IF(SUM(COUNTIFS(A2,{"*DK*","*TK*"})),"Knitted",IF(SUM(COUNTIFS(A2,{"*DW*","*TW*","*BW*","*SW*"})),"Woven",""))

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Find characters in cells and return specified text

    Or try

    =IF(COUNT(FIND({"DK","TK"},A2)),"Knitted",IF(COUNT(FIND({"DW","TW","BW","SW"},A2)),"Woven",""))

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,788

    Re: Find characters in cells and return specified text

    Did you try the formula I suggested?

  9. #9
    Registered User
    Join Date
    07-29-2022
    Location
    Manchester, England
    MS-Off Ver
    Version 2206
    Posts
    8

    Re: Find characters in cells and return specified text

    Hi,

    This was close but it's still not working as expected. Most cells should come up as N/A as they don't contain any of those combinations.
    It seems to be partly working or maybe I've messed up the formula somehow!

    Cheers,
    Jake
    Attached Files Attached Files

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,006

    Re: Find characters in cells and return specified text

    Administrative Note:

    Members will tailor the solutions they offer to the version (NOT a release number like 2206) of Office (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this. Thanks.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,788

    Re: Find characters in cells and return specified text

    It seems like I'm either invisible, or just being ignored.

  12. #12
    Registered User
    Join Date
    07-29-2022
    Location
    Manchester, England
    MS-Off Ver
    Version 2206
    Posts
    8

    Talking Re: Find characters in cells and return specified text

    Fluff13 you are not being ignored!

    Winner! I've tried your formula and it appears to be working!

    I'm probably going to need to do more jiggery-pokery with this so will keep the thread open.

    Thanks for the help!

  13. #13
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,788

    Re: Find characters in cells and return specified text

    Glad it helped & thanks for the feedback.

  14. #14
    Registered User
    Join Date
    07-29-2022
    Location
    Manchester, England
    MS-Off Ver
    Version 2206
    Posts
    8

    Re: Find characters in cells and return specified text

    Adding to this I have extended the formula to include the characters I want however there is a list with cells that may contain these characters and I want this list to be ignored.

    Is there a way of adapting this formula to not include strings of characters in the specified cells.

    =IF(SUM(COUNTIFS(A4,{"*DK*","*TK*","*TJ*","*BJ*","*DJ*"})),"Knitted",IF(SUM(COUNTIFS(A4,{"*DW*","*TW*","*BW*","*SW*","*DD*","*DP*","*DL*","*TD*","*BD*","*BP*","*BL*","*SL*","*SD*","*DM*","*DD*","*TD*"})),"Woven",""))

    I have included an example. Sheet 1 contains the formula sheet 2 includes the cells highlighted in red that I want to ignore. For example one of these cells contains 'RDWE01' so in this instance where DW has been used in this string it would be ignored.

    Hope that makes sense, thanks in advance.

    JakeExample.xlsx

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Find characters in cells and return specified text

    Not much!!

    Please amend to show expected answers, where you expect to see them.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

+ 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. Excel Use Word to Find Text and return the following 10 characters
    By baggieade in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-11-2015, 07:45 AM
  2. Formula to find and return text in a range of cells
    By razkowski in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-23-2015, 06:57 PM
  3. Replies: 3
    Last Post: 03-11-2015, 03:25 PM
  4. Replies: 2
    Last Post: 11-20-2014, 10:26 AM
  5. Find lowest value from 4 numbers in various cells and return text
    By mheinmiller in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-27-2014, 05:32 AM
  6. Replies: 2
    Last Post: 09-07-2013, 07:50 PM
  7. Formula to find text on a page and return that cells name.
    By Kevin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-02-2005, 10:05 AM

Tags for this Thread

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