+ Reply to Thread
Results 1 to 10 of 10

Displaying a Number if a specific cell contains specific text

  1. #1
    Registered User
    Join Date
    09-07-2017
    Location
    Birmingham, England
    MS-Off Ver
    2016
    Posts
    5

    Displaying a Number if a specific cell contains specific text

    Hi,

    I'm looking for a formula in to display a number (cost) in a specific cell if another specific cell contains text (address).

    At the moment I have 4 columns. One for location (E2 : E146), one for Cost (M2 : M146), one with all the addresses (N2:N146) and one for the total cost (Q2:Q146).

    I need column M to pull through the cost of column Q if column E contains one of the addresses from Column N.

    Hopefully this makes sense as I'm pretty new to excel and formulas.

    Thank you in advance.

    Connor

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

    Re: Displaying a Number if a specific cell contains specific text

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn



  3. #3
    Registered User
    Join Date
    09-07-2017
    Location
    Birmingham, England
    MS-Off Ver
    2016
    Posts
    5

    Re: Displaying a Number if a specific cell contains specific text

    Thanks for the rapid response Glenn.

    I've done as you requested and attached an example for you.

    Cheers

    Connor
    Attached Files Attached Files

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

    Re: Displaying a Number if a specific cell contains specific text

    I'm not sure how realistic your example is, since the two address columns contain exactly the same data, but, for starters, try this:

    =SUMIFS(Q:Q,E:E,N2)

  5. #5
    Registered User
    Join Date
    09-07-2017
    Location
    Birmingham, England
    MS-Off Ver
    2016
    Posts
    5

    Re: Displaying a Number if a specific cell contains specific text

    Thanks Glenn, there are two address columns as I needed one to make a list for column E.

    They will be mixed up & not in order. I should have noted that in the example. I've attached a better example which may make more sense.

    Its a list of requests so there may be multiple of the same and in any which way it comes through.

    Does that make more sense?
    Attached Files Attached Files

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

    Re: Displaying a Number if a specific cell contains specific text

    OK. So does the formula work, or not?? If not, what are they expected answers. It seems OK to me?

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    7,685

    Re: Displaying a Number if a specific cell contains specific text

    Try this in M2, then drag down

    =INDEX($Q$2:$Q$10,MATCH($E2,$N$2:$N$10,0))
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  8. #8
    Registered User
    Join Date
    09-07-2017
    Location
    Birmingham, England
    MS-Off Ver
    2016
    Posts
    5

    Re: Displaying a Number if a specific cell contains specific text

    Thanks Glenn. That works.

    Is there a way to add an additional value onto the output?

    Whenever a course type is selected in column B it needs to add a specific amount ontop of the first figure.

    For example:
    HS131 = 390
    HS131A = 390
    HS197 = 650
    HS197A = 390
    HS201 = 650
    HS201A = 390

    So in row 2 it would need to pull through an additional 390 ontop of the 86.72.
    But it could be any of the 6 course types for any row.

    Cheers

    Connor

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

    Re: Displaying a Number if a specific cell contains specific text

    Is this it?

    =SUMIFS(Q:Q,E:E,N2)+VLOOKUP(B2,Sheet2!$A$2:$B$7,2,FALSE)
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    09-07-2017
    Location
    Birmingham, England
    MS-Off Ver
    2016
    Posts
    5

    Re: Displaying a Number if a specific cell contains specific text

    I think I managed to sort my other question.

    Added another column for the extra value and added another +sum at the end.

    Thanks guys.

    Appreciated the help.

+ 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] if cell contain a specific text then add specific number if not add another number
    By Fielt21 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-17-2016, 04:28 AM
  2. Help with IF Functions in displaying specific text from specific cells
    By Chuckchan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-30-2015, 04:19 PM
  3. Replies: 3
    Last Post: 04-30-2015, 08:00 AM
  4. [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
  5. Replies: 10
    Last Post: 04-11-2014, 03:11 PM
  6. Replies: 2
    Last Post: 08-05-2013, 07:32 PM
  7. [SOLVED] Displaying Specific Text in Cell Based on Text in Another
    By wowcrofty in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-29-2012, 12:11 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