Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6955675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:46:05+00:00 2026-05-27T14:46:05+00:00

I have a problem, http://goo.gl/i82eA this is sample data that I have with the

  • 0

I have a problem, http://goo.gl/i82eA this is sample data that I have with the required output. Currently I have a user defined function that is manually using many if statements to do the job but I want to be able to do something like a vlookup if it finds a certain color in a colum and return the colormap coresponding to it.

Or use like a filter function like filter all cells that contain Blue and give the destination cell with blue, and then run next filter with next value in an table of colors.


Color   ColorMap     Text             Required Output
blue    blue         Deep Blue Shoe   Blue (if Text contains blue return blue)
red     red          Deep red Shoe    red (if Text contains red return red) etc
tan     brown        Tan Shoe         brown
navy    blue         Navy Emp Shoe    blue
jade    green        Jade Shoe        green
plum    red          Plum Red Shoe    multicoloured (if Text contains more than 1 color return multicolored)

So input should be like 2 columns for the data to be looked up 1 column for searching and the 1 column is the destination column if its a function

function_name(lookup_text,lookup_table,destination)

Thanks in advance

ps: here is the code Im using now

Code:

Function Colormap(strVal As String) As String

If (InStr(strVal, "red") > 0) Then
    Colormap = "Red"
End If

If (InStr(strVal, "Beige") > 0) Then
    Colormap = "Beige"
End If

etc..

End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:46:06+00:00Added an answer on May 27, 2026 at 2:46 pm

    This looks up the Text value and returns the ColorMap value; if more than one match is found “multicolored” is returned. Note: This is an array formula–enter it with Ctrl+Shift+Enter.

    =IF(SUM(IF(ISNUMBER(SEARCH(A$2:A$7,C2)),1,0))>1,"multicolored",LOOKUP(2^15,SEARCH(A$2:A$7,C2),B$2:B$7))

    Here’s a function that does the same thing. It requires that the reference table be a named range. Call the function like this: =ColorMap(C2,"ColorTable") where ColorTable is a named range referring to $A$2:$B$7.

    Public Function ColorMap(LookupValue As Variant, LookupTableName As String) As String
        Dim vTable As Variant
        Dim lIdx As Long
        Dim sColor As String
    
        ' transfer lookup table to 2D range & loop through to find matches
        vTable = Names(LookupTableName).RefersToRange.Value
        For lIdx = LBound(vTable, 1) To UBound(vTable, 1)
            If UCase$(LookupValue) Like "*" & UCase$(vTable(lIdx, 1)) & "*" Then
                sColor = sColor & ", " & vTable(lIdx, 2)
            End If
        Next lIdx
        If Len(sColor) > 2 Then sColor = Mid$(sColor, 3)
        ' map multiple matches to "multicolored"
        If InStr(sColor, ",") > 0 Then sColor = "multicolored"
        ColorMap = sColor
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem - i can't compile SqlCipher. I'm using this http://groups.google.com/group/sqlcipher/browse_thread/thread/55c6296b56bf4533/c792bbec6df7d4f4?tvc=2#c792bbec6df7d4f4 instructions
I have a little problem with some jquery and http://www.mikage.to/jquery/jquery_history_noc.html The function works great,
I have problems with following code: http://lisper.ru/apps/format/96 The problem is in normalize function, which
Hello I have a problem with this http://jsfiddle.net/E7dGA/1/ When the script starts and you
I have a big problem opening http://localhost/ on Windows 7 (beta). I installed this
I'm doing this problem: http://www.codechef.com/problems/FCTRL I have the solution, but, the memory usage is
Here is a live example of my problem http://jsfiddle.net/littlesandra88/xksB9/ I would have expected that
I have encoding problem with iText ( http://www.lowagie.com/iText/ ). I load data from database
I have this webpage the OK : http://ldetek.com/a.jpg the problem : http://ldetek.com/b.jpg Why is
I have problem with HTTP headers, they're encoded in ASCII and I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.