+ Reply to Thread
Results 1 to 8 of 8

If cell A contains specific text and cell b contains specific text then return this value

  1. #1
    Forum Contributor
    Join Date
    06-24-2013
    Location
    United Kingdom
    MS-Off Ver
    Office 365
    Posts
    114

    If cell A contains specific text and cell b contains specific text then return this value

    Afternoon

    If I have a cell A containing "Shop" and cell B containing "$9.99" I need it to look up a table that has numerous values

    $9.99
    $10.99
    $15.99

    and respond with a £ value

    Shop $9.99 £8.99
    Shop $10.99 £9.99
    Shop $15.99 £14.99

    Warehouse $9.99 £9.99
    Warehouse $10.99 £10.99
    Warehouse $15.99 £15.99

    so

    if Shop and $9.99 found then give me £8.99

    but

    if Warehouse and $9.99 give me £9.99

    Gonna try myself but probably wont get there.

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,085

    Re: If cell A contains specific text and cell b contains specific text then return this va

    Try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let me know if you have any questions.
    Last edited by JeteMc; 05-04-2016 at 09:34 AM. Reason: Correcting an error in formula
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Contributor
    Join Date
    06-24-2013
    Location
    United Kingdom
    MS-Off Ver
    Office 365
    Posts
    114

    Re: If cell A contains specific text and cell b contains specific text then return this va

    Hi Sorry

    Dont think explain it fully, having issues posting and amending.

    Shop $9.99 £8.99
    Shop $10.99 £9.99
    Shop $15.99 £14.99

    Warehouse $9.99 £9.99
    Warehouse $10.99 £10.99
    Warehouse $15.99 £15.99

    This part is in a table

    So I would have one column thats says shop/warehouse...etc numerous different text and I have some tables that have shop, warehouse...etc with corresponding values.

    So I need to look at said column and see if it has "Shop" or "Warehouse" or something else in my lookup table. And then look at another column that is the price then return the 3rd column from the lookup table with the correct price.

    So if A1 and D1 are this then correct result is this

    A1 Shop
    D1 $9.99

    in lookup table its

    Shop $9.99 £8.99

    So for every row that has shop,$9.99 in my new column it would say £8.99

    This was if I change the price I can just change the £8.99 and its all automatic.

    Really hope that makes sense.

  4. #4
    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
    30,975

    Re: If cell A contains specific text and cell b contains specific text then return this va

    Try

    =IFERROR(INDEX($K$1:$K$100,MATCH(1,INDEX(($I$1:$I$100=A1)*($J$1:$J$100=D1),0),0)),"")

    Table in Columns I to K

  5. #5
    Forum Contributor
    Join Date
    06-24-2013
    Location
    United Kingdom
    MS-Off Ver
    Office 365
    Posts
    114

    Re: If cell A contains specific text and cell b contains specific text then return this va

    Ok have attached a spreadsheet

    Sheet 1 Column B is type of product, Column J is the price

    Sheet 2 has the lookup values and output is the column L

    So when it says Previews Publications an $2.99 the value would be £2.99
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,085

    Re: If cell A contains specific text and cell b contains specific text then return this va

    Adapting John's formula to the file paste the following in Sheet1!L2 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Note: Trim the extra spaces from the end of the text in Sheet1!B2:B4
    Let me know if you have any questions.

  7. #7
    Forum Contributor
    Join Date
    06-24-2013
    Location
    United Kingdom
    MS-Off Ver
    Office 365
    Posts
    114

    Re: If cell A contains specific text and cell b contains specific text then return this va

    Hi JetMc

    Thanks for for formula it works like a charm, if I was to add another another column to look at say H, would that be like this

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

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,085

    Re: If cell A contains specific text and cell b contains specific text then return this va

    Seems like your formula should work. My best advice would be to test it and if it doesn't work upload a sample worksheet with your expected results manually input. In the likely event that it works and if you are satisfied with the solution, please take a moment to mark the thread 'Solved' using the thread tools link above your first post.

+ 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] Return Cell Value if Contains Specific Text
    By MausDef in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-14-2015, 07:41 AM
  2. [SOLVED] VBA to Find Specific Text, then Copy range to next open cell under specific text
    By Remotruker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2015, 10:59 AM
  3. Return specific value IF specific text in cell
    By scones in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-14-2015, 01:18 AM
  4. [SOLVED] If cell contains specific text, return that text
    By kazphilips in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2014, 09:41 AM
  5. Replies: 2
    Last Post: 08-05-2013, 07:32 PM
  6. [SOLVED] If a cell contains a specific text than return a value
    By dcdeez in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-04-2013, 08:31 AM
  7. Replies: 3
    Last Post: 06-20-2012, 07:16 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