+ Reply to Thread
Results 1 to 5 of 5

lookup, with word substitution and matches it to a value

  1. #1
    Registered User
    Join Date
    06-01-2010
    Location
    South West
    MS-Off Ver
    Excel 365
    Posts
    7

    lookup, with word substitution and matches it to a value

    I have a speadsheet with hundreds of row, a sample file is attached.

    I require a formaula that does a lookup, does a word substitution and matches it to a value. The formulas are required for columns F, H and J.

    The resulting value of formula comes from the preceeding column (E, G and I)

    The formula should lookup the "VM Name" that is prefixed with the word "windows-" and take the value in column E where the "VM Name" is prefixed with the word "linux-"

    For example F2 should have the value of E16, H2 should have the value of G16, and J2 should have the value of I16, because its source column A2 value is "windows-ds5v2" and if we lookup its linux equivilent in "VM Name" we find "linux-ds5v2" that has a cost value of "1.405", "0.63333", and "0.42698" respectively, in columns E, G and I.

    I have provided two worksheets, 1 that requires the formaula, and 1 that shows what the final output should look like when a formaula is used.

    Please note, that the should be no values retruned to columns F, H and J where "VM Name" is prefixed with the word "linux-"
    Attached Files Attached Files
    Last edited by g3xer; 08-22-2021 at 02:28 AM.

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: lookup, with word substitution and matches it to a value

    Try this in F2:

    =VLOOKUP(SUBSTITUTE(A2,"windows-","linux-"),A:E,5,0)

  3. #3
    Registered User
    Join Date
    06-01-2010
    Location
    South West
    MS-Off Ver
    Excel 365
    Posts
    7

    Re: lookup, with word substitution and matches it to a value

    The probelm with "=VLOOKUP(SUBSTITUTE(A2,"windows-","linux-"),A:E,5,0)" as a formula is that it also returns results for the linux machines machines, but these need to be blank

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: lookup, with word substitution and matches it to a value

    =IF(LEFT(A2,7)="windows",VLOOKUP(SUBSTITUTE(A2,"windows-","linux-"),A:E,5,0),"")

  5. #5
    Registered User
    Join Date
    06-01-2010
    Location
    South West
    MS-Off Ver
    Excel 365
    Posts
    7

    Re: lookup, with word substitution and matches it to a value

    That is amazing, thank you, thank you, thank 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. Lookup all matches for multiple lookup values
    By jenbellacosa in forum Excel General
    Replies: 3
    Last Post: 04-14-2021, 11:11 AM
  2. Question - Substitution function is substitution its own values
    By debrad1207 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-01-2018, 10:23 AM
  3. Replies: 3
    Last Post: 08-23-2017, 07:04 PM
  4. Creating a three way lookup with columns and row lookup matches
    By jimbob23 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-19-2014, 10:58 PM
  5. Replies: 15
    Last Post: 05-28-2014, 05:57 AM
  6. [SOLVED] IF b = Matches then type a word in c
    By m_789 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-01-2014, 05:40 AM
  7. Word Substitution
    By Vinnie Chan in forum Excel General
    Replies: 6
    Last Post: 11-25-2009, 03:14 PM

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