+ Reply to Thread
Results 1 to 10 of 10

Forumla Combination

  1. #1
    Registered User
    Join Date
    04-28-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    7

    Forumla Combination

    Hi,

    I have an xlsx that is an export of login data. I'm trying to search field A2 for specific text, and if it true, write something in the cell where I'm running the formula from, D2. The first example below works great, but if the cell says contains multiple words such as "1 brown apple", 'a very ripe avocado" (you get the point), the formula returns nothing. If the cell contains only the word apple, then it works great. I was trying to combine the first formula w the second formula below, but no luck.


    =IF(A2="apple", "Ap", IF(A2="avocado", "Av", IF(A2="banana", "B", IF(A2="Lemon", "L", ""))))

    =IF(AND(ISNUMBER(SEARCH("apple",A2)),ISNUMBER(SEARCH("log",A2))),"Valid ","")


    Can anyone assist in searching a cell that has multiple pieces of text (imagine a whole sentence) and write the results to a cell?


    Thank you so much! My xlsx skills are ok, but no match for the internet!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,852

    Re: Forumla Combination

    It would help if you attached a sample Excel workbook, then we can see how your data is laid out. To do this, just follow the guidelines given in the yellow banner near the top of the screen, which I have reproduced below:

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    Hope this helps.

    Pete

  3. #3
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,791

    Re: Forumla Combination

    Administrative Note:

    Is your forum profile showing the Excel PRODUCT that you need this to work for?

    Members will tailor the solutions they offer to the Office PRODUCT (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 product is for Mac, please also state this.

    The three most recent Excel products are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the version number in your profile (e.g. MS365 Version 2306). This is in the About Excel section further down the Account page.

    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.
    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.

  4. #4
    Registered User
    Join Date
    04-28-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Forumla Combination


  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,852

    Re: Forumla Combination

    You can use this formula in D2:

    =IF(ISNUMBER(SEARCH("apple",A2)),"Ap ","")& IF(ISNUMBER(SEARCH("avocado",A2)),"Av ","")& IF(ISNUMBER(SEARCH("banana",A2)),"B ","")& IF(ISNUMBER(SEARCH("lemon",A2)),"L ","")

    then copy down. If you had multiple words from your list in one cell, like "apple and avocado", then you will get Ap Av as the result.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    04-28-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Forumla Combination

    Pete, you're rockstar, thank you! I'm going to give this a go right now!

    Thanks!

  7. #7
    Registered User
    Join Date
    04-28-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Forumla Combination

    A quick update, the formula works great!! One follow up question that I didn't think of... What if I wanted to add to the formula to also search for the phrase "green apple" in addition to "apple"? How would I account for the both words with a space between them?

    Thank you!!

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,852

    Re: Forumla Combination

    If that is a separate entry, for which you want to return some code like Ga, then you could amend the formula like this:

    =IF(ISNUMBER(SEARCH("apple",A2)),"Ap ","")& IF(ISNUMBER(SEARCH("avocado",A2)),"Av ","")& IF(ISNUMBER(SEARCH("banana",A2)),"B ","")& IF(ISNUMBER(SEARCH("lemon",A2)),"L ","")& IF(ISNUMBER(SEARCH("green apple",A2)),"Ga ","")

    However, if you had green apple together in a cell the formula would then produce Ap Ga, as "apple" is a subset of the entry, which is probably not what you want.

    It's getting a bit late here, and tomorrow I'm off for a long weekend, so I won't be able to contribute anything else until Tuesday. But, if that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    You might also like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  9. #9
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,791

    Re: Forumla Combination

    Are you still using Excel 2003? Please don't ignore my question this time.

  10. #10
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,558

    Re: Forumla Combination

    Cell D2 formula , Drag down

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

+ 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] How to make the combination of numbers and total of that combination should be in range?
    By Darshan Shah in forum Excel Programming / VBA / Macros
    Replies: 38
    Last Post: 06-20-2020, 01:20 PM
  2. Networkdays Forumla and MOD combination
    By nr6281 in forum Excel Formulas & Functions
    Replies: 28
    Last Post: 08-12-2019, 11:24 AM
  3. Make forumla lookup value rather than forumla
    By Jbraviator in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-09-2015, 01:00 PM
  4. Conditional Forumla with Forumla assigned- Help needed
    By MarkoPolo in forum Excel General
    Replies: 3
    Last Post: 03-06-2014, 06:46 PM
  5. [SOLVED] how many cell in a row that contain certain combination from a larger combination
    By system in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 11-17-2012, 03:04 PM
  6. [SOLVED] Forumla
    By Don in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  7. Replacing a cell's forumla with the forumla's results?
    By Mooncalf in forum Excel General
    Replies: 2
    Last Post: 01-04-2005, 12:35 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