+ Reply to Thread
Results 1 to 10 of 10

Make multiple words equal a value.

  1. #1
    Registered User
    Join Date
    04-07-2015
    Location
    St. Louis
    MS-Off Ver
    Microsoft Office 2010
    Posts
    3

    Post Make multiple words equal a value.

    Can you make more than one word equal to a value in Excel? I know this formula =VLOOKUP(C1,A$1:B$20,2,FALSE) will work for one word, but not multiple words. I need it for multiple words. I need the cell to use multiple words in other cells to equal out one price. Example: Lettuce - $0.05, Tomato - $.06, Onion - 0.04..etc and for the cell to add up all the words and the prices associated with them. Thank you.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Make multiple words equal a value.

    Sounds like you need a sumif stmt? More detail needed to write one though.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Make multiple words equal a value.

    so this would be an example, say that your values like Lettuce, onion, tomato etc are in col A and your prices in col B. You can put this formula elsewhere. =SUMIF(A:A,"lettuce",B:B) Or create a table of the values, say in col C you make a defined list of your products like Lettuce in C1 for example, then change the formula to this =SUMIF(A:A,C1,B:B) etc.

  4. #4
    Registered User
    Join Date
    04-07-2015
    Location
    St. Louis
    MS-Off Ver
    Microsoft Office 2010
    Posts
    3

    Re: Make multiple words equal a value.

    In Column A I have all the items in this case they are food ingredients such as lettuce, tomato, onion, pickle, etc. In Column B I have all the items prices. In column C1 I have written the word Pickle which it values at $0.05. In D3 I have the formula =VLOOKUP(C1,A$1:B$20,2,FALSE . So it recognizes the word Pickle and associates it with $0.05 since that is that items price. The problem I'm having is that I can only use one word. If I add "lettuce" to the same cell as the word "Pickle" it not longer recognizes the value. I'm just looking for the cell to allow me to use more than just one food ingredient to get my total value. My goal is to put all "lettuce, tomato, pickle, onion" all into one cell and it instantly tell me the total price of all those ingredients based just off the words since they their prices already. I'm bad at explaining this I'm sorry.

  5. #5
    Registered User
    Join Date
    04-07-2015
    Location
    St. Louis
    MS-Off Ver
    Microsoft Office 2010
    Posts
    3

    Re: Make multiple words equal a value.

    image.jpg

    This is my quick example

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Make multiple words equal a value.

    I can't think of any way to do that without using VBA or a very complicated find or search function. If you wanted to keep them in separate cells it should be pretty easy, you could use multiple sumif stmts or use a sumifs stmt.

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,596

    Re: Make multiple words equal a value.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,461

    Re: Make multiple words equal a value.

    You can use SEARCH to find then SUMPRODUCT like this:

    Untitled.png


    Assuming A1:A8: Names; B1:B8: prices; E1: Name consolidation

    =SUMPRODUCT(ISNUMBER(SEARCH(A1:A8,E1))*B1:B8)
    Quang PT

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Make multiple words equal a value.

    Hello bebo021999,

    This works well for your example but XxshawowdawgxX has both "Bacon" and "Bacon bits" in his ingredient list. When one ingredient is a substring of another you may get the wrong result, e.g. if E1 contains "Bacon bits" then your formula will add the prices for both Bacon and Bacon bits.

    To prevent that, assuming all ingredients separated by commas you can use this amended formula:

    =SUMPRODUCT(ISNUMBER(SEARCH(","&A1:A8&",",","&E1&","))*B1:B8)
    Audere est facere

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Make multiple words equal a value.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ 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. Replies: 7
    Last Post: 06-05-2014, 02:50 AM
  2. How to get words to equal a number
    By Anmari in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-10-2014, 04:03 PM
  3. [SOLVED] How to use a different words to equal other words
    By unclejemima in forum Excel General
    Replies: 6
    Last Post: 11-08-2013, 11:48 PM
  4. [SOLVED] make multiple cells in 1 worksheet equal multiple cells in another
    By riley454 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-19-2006, 11:10 AM
  5. Words Equal Numbers Question
    By Crew in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2005, 03:05 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