Which is the best function

I am using Excel 2016. I need to figure how to get the cell to calculate the total by adding specific amounts which are based on an index. 

For the example below,

The assumptions are customers will only buy up to 3 items. and will only get 1 of each item

The order of the item matters.

Column C is the name of each item, Column D is the price of the item, Column E is where data will be entered with the index 1,2,3 to represent the order in which items are ordered. 

The first item’s price has to be from Column C. The price for the second item is fixed at 8 and third item 5. The customer might only order 1 item.

I need to add all these values together to give a total based on the conditions. 

What I expect the formula to do

The formula will first need to scan Column E to see if the index of 1,2 and 3 has been entered. If none is entered then the return value should be 0. If index 2 or 3 has been entered without index 1, then it should return ERROR.

For the value of index 1, the formula needs to look up the row in which the index is entered in column E then match its value from Column D and return that value.

For the value of index 2 (if there is one), the formula should return the value 8.

For the value of index 3 (if there is one), the formula should return the value 5.

The formula should add all the amount and give me a total value for the order. 

By: Lina Tan

19 thoughts on “Which is the best function

  1. ig

    Howdy! I know this is kinda off topic nevertheless I’d figured I’d ask.

    Would you be interested in trading links or maybe guest authoring a blog article or vice-versa?
    My website goes over a lot of the same subjects
    as yours and I feel we could greatly benefit from each
    other. If you might be interested feel free to shoot me an email.
    I look forward to hearing from you! Wonderful blog by the way!

  2. club-dieta.ru

    Just wish to say your article is as amazing. The clarity in your post is just excellent
    and i could assume you’re an expert on this subject.
    Fine with your permission let me to grab your RSS feed
    to keep up to date with forthcoming post.
    Thanks a million and please carry on the enjoyable work.

  3. vurtil opmer

    Generally I don’t read post on blogs, but I wish to say that this write-up very forced me to check out and do so! Your writing taste has been surprised me. Thank you, quite nice post.

  4. sling tv

    Thanks for one’s marvelous posting! I seriously enjoyed reading it, you happen to be a great author.I will ensure that I bookmark your blog and may come back in the future.
    I want to encourage yourself to continue your great work, have a nice morning!

  5. sling tv

    Have you ever thought about including a little bit more
    than just your articles? I mean, what you say is
    fundamental and all. But think about if you added some great
    pictures or video clips to give your posts more, “pop”! Your content is excellent
    but with images and video clips, this website could undeniably
    be one of the very best in its niche. Fantastic blog!

  6. sling tv

    Hello, I think your website might be having browser compatibility issues.
    When I look at your blog in Ie, it looks fine but when opening in Internet Explorer, it
    has some overlapping. I just wanted to give you a quick heads up!
    Other then that, very good blog!

  7. tinyurl.com

    Wonderful blog! I found it while browsing on Yahoo News.

    Do you have any suggestions on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!


  8. sling tv

    We are a group of volunteers and starting a brand new scheme in our community.
    Your site offered us with helpful info to work on. You
    have performed an impressive task and our entire neighborhood shall be thankful to you.

  9. coconut oil

    I love your blog.. very nice colors & theme. Did you make this website yourself or did you hire someone to do it for you?
    Plz respond as I’m looking to construct my own blog and would like to
    find out where u got this from. thanks

  10. ps4 games

    Incredible! This blog looks exactly like my old one!
    It’s on a totally different topic but it has pretty much the same layout and design. Outstanding choice
    of colors!

  11. quest bars cheap

    Hello! I just wanted to ask if you ever have any trouble with hackers?
    My last blog (wordpress) was hacked and I
    ended up losing many months of hard work due to no backup.
    Do you have any methods to prevent hackers?

  12. quest bars cheap

    whoah this blog is wonderful i like reading
    your posts. Stay up the great work! You know, lots of individuals are looking around for
    this information, you can aid them greatly.

  13. tinyurl.com

    It is in reality a great and useful piece of info. I’m satisfied
    that you shared this useful info with us. Please keep us up to date like this.

    Thank you for sharing.

Comments are closed.