Creating Total Cost for a List of Items in Square Brackets Separated by Commas

Aran Billen 906 Reputation points
2023-09-25T11:35:23.1433333+00:00

I have a list of items with their corresponding prices stored in a separate sheet named 'Menu Costs' in Excel. I want to create a formula in another sheet that calculates the total cost for a list of items I enter into a cell. Each item will be enclosed within square brackets, and I will separate the items with commas if there is more than one item which is due to me using a power automate flow to input the data automatically from forms into the excel sheet

My Objective:

  1. Extract the individual items from “food options” cell looks like: like this ["Hot/Cold Drinks & biscuit","Tray bake/cookie”].
  2. Look up the prices for each item in the 'Menu Costs' sheet.
  3. Multiply each item's price by a specified quantity.
  4. Sum up the individual costs to calculate the total cost.

Excel sheet:

Screenshot 2023-09-25 at 12.33.25

Menu Costs:

Screenshot 2023-09-25 at 12.33.30

Current formula in cost column which works if I use one Food field within the Food Options column

=VLOOKUP(E2,'Menu Costs'!A:B,2,FALSE)*C2

PLease help!

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,175 questions
{count} votes

3 answers

Sort by: Most helpful
  1. steave maxi 0 Reputation points
    2024-08-02T10:09:02.72+00:00

    To calculate the total cost for a list of items entered in a cell, you can use the following approach in Excel:

    Split Items: Use a formula to split the items into an array.

    Lookup Prices: Use VLOOKUP or INDEX/MATCH to find prices from the "Menu Costs" sheet.

    Sum Prices: Sum the prices to get the total cost.

    For example, use TEXTSPLIT (or a custom function for older Excel versions) to split the items, and SUMPRODUCT with VLOOKUP to calculate the total.

    Regarding Jack in the Box menu with prices, the menu offers a variety of fast food options including burgers, tacos, and breakfast items, making it a convenient choice for diverse tastes.

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.