+ Reply to Thread
Results 1 to 7 of 7

Multiplication based on multiple variables

  1. #1
    Registered User
    Join Date
    03-23-2017
    Location
    Seychelles
    MS-Off Ver
    Excel Mac 2011
    Posts
    3

    Unhappy Multiplication based on multiple variables

    Hi,

    I have looked high and low for a solution, I have searched for all variables I can think of and sadly have not been able to find anything online and at a complete standstill.

    My problem. I am trying to build an inventory spreadsheet which will automatically calculate how much an item is sold for.

    My admin tab will contain prices set out like below (this is up for changes too if there is a better way):
    Product Retail Wholesale Discount **Additional**
    Chocolate 2 1 1.5
    Soda 1.5 1 1.2
    Cake 10 5 7
    Juice 2.5 1.5 2

    On my Sales tab I will have two pull down lists one for product, one for Buyer and one third for how many items sold. I am trying to create a formula which will calculate number of items sold multiplied by sale price (so if they purchased 5 and chose Cake & Discount it would calculate 5 * 7, Cake & Retail would be 5*10, etc).

    I have managed to do this using nested if statements, while this works it is very limited and not expandable (adding just 1 more product or buyer would exponentially add more nested ifs).

    Ideally I would like (maybe) the formula role down a list of products and buyers until empty and calculate on that.

    I'm close to giving up and any and all help is much appreciated. If I have missed out any information let me know. On that if what I've typed is totally confusing let me know too and I'll try to redo it. Also, it this has been asked previously apologies for not being able to find it... If you can send me the link to the thread it'd be appreciated.

    Thanks in advance
    Dave

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Multiplication based on multiple variables

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.




    To add a file to a post

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,185

    Re: Multiplication based on multiple variables

    Try

    =INDEX($A2:$D5,MATCH(Product,$A2:$A5,0),MATCH(Buyer,$A$1:$D$1,0))*Quantity

    Assuming table in your post is in range A1:D5

    Product= e.g. "Chocolate"

    Buyer= e.g "Retail"

    OR

    =VLOOKUP(Product,$A$2:$D$5,MATCH(Buyer,$A$1:$D$1,0),0)*Quantity

    Amended .....
    Last edited by JohnTopley; 03-23-2017 at 09:19 AM.

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Multiplication based on multiple variables

    If you're using drop-down lists, then you can replace the 'Product' and 'Buyer' in John's formulae above with references to those cells. Also, assuming that your formula is going on your Sales sheet, the references to this table on your Admin sheet will need to include the sheet name. So you'll end up with something like this:
    =INDEX(Admin!$A2:$D5,MATCH(A2,Admin!$A2:$A5,0),MATCH(B2,Admin!$A$1:$D$1,0))*C2
    where A2 is your 'Product' drop-down cell, B2 is your 'Buyer' drop-down and C2 is where the quantity is listed.

    Hope that makes sense...
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  5. #5
    Registered User
    Join Date
    03-23-2017
    Location
    Seychelles
    MS-Off Ver
    Excel Mac 2011
    Posts
    3

    Re: Multiplication based on multiple variables

    Thanks for the suggestions guys (also sorry for slow reply - I work on a remote base in Africa and have limited internet usage). I will try these suggestions and if I can't get them to work I will attach a demo file as per davesexcel suggests.

    Thanks again.

    Fingers crossed I can figure it all out!!

  6. #6
    Registered User
    Join Date
    03-23-2017
    Location
    Seychelles
    MS-Off Ver
    Excel Mac 2011
    Posts
    3

    Angry Re: Multiplication based on multiple variables

    Hey guys,

    I have tried both suggestions and messed around with the formulas a bit and all I can seem to get it to respond with is either ?NAME or a number (not useful number; just a 1 or 2 which doesn't correspond to any of the prices).

    I will attach a SUPER basic file as I have just managed to delete my master file (and of course true to fan and sh*t colliding I have no backup) that I have been working on for the past few hours (insert countless face palms and head plants here).

    Thanks again guys. I'm starting to regret taking this what I thought to be simple project on.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,185

    Re: Multiplication based on multiple variables

    In D2

    =INDEX(Admin!$A$2:$D$5,MATCH($A2,Admin!$A$2:$A$5,0),MATCH($B2,Admin!$A$1:$D$1,0))*$C2

    Copy down

+ 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. Sum and Multiplication based on multiple conditions
    By rnalaja in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 02-21-2017, 12:37 PM
  2. [SOLVED] Conditional SUMIF based on multiple columns and multiple row variables
    By jaymaan74 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-15-2016, 11:05 AM
  3. [SOLVED] Sum multiple columns based on multiple variables
    By dmschave in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-29-2014, 11:25 AM
  4. [SOLVED] VLOOKUP Based on Multiple Variables
    By bgauthier in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-11-2013, 02:55 PM
  5. Need a count based on multiple variables
    By Kassie93 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-30-2012, 08:11 AM
  6. Max value based on multiple variables
    By Kaziglu Bey in forum Excel General
    Replies: 5
    Last Post: 06-28-2011, 06:21 AM
  7. Max based on multiple variables with multiple parameters
    By Latszer in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 10-09-2009, 03:39 AM

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