+ Reply to Thread
Results 1 to 10 of 10

supplier based on price and quantity

  1. #1
    Registered User
    Join Date
    11-27-2020
    Location
    Lithuania
    MS-Off Ver
    Office 365
    Posts
    5

    supplier based on price and quantity

    Hey,
    I got an issue where I need to select largest quantity supplier based on best price, when the price is equal
    I was able to get the supplier with lowest price with the formula:
    =INDEX(B1:F1;MATCH(MIN(B2:F2);B2:F2;0))

    but I can't figure out how to get the lowest quantity when there are multiple min values

    sup.png


    I can also get the supplier price with
    =INDEX(B2:F2;MATCH(B6;B1:F1;0))
    Attached Images Attached Images
    Last edited by The_ShadowWw; 11-27-2020 at 08:11 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,893

    Re: supplier based on price and quantity

    Exactly what are you looking for: the smallest price with the largets quantity or the smallest price PER UNIT?

    Please read the yellow banner (top of screen) and post a sample sheet (not a picture of one) showing What you expect to see WHERE you expect to see it.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    11-27-2020
    Location
    Lithuania
    MS-Off Ver
    Office 365
    Posts
    5

    Re: supplier based on price and quantity

    I hope I attached the file
    finding the supplier with the lowest price is easy and it is done in B6, I can also get the price in B7
    but if there are 2 suppliers with equal (lowest price) then it should get the supplier with the largest quantity,
    in the given example it should be sup4 as
    sup2 and sup4 have the same lowest price, but the quantity of sup4 is larger
    Attached Files Attached Files
    Last edited by The_ShadowWw; 11-27-2020 at 08:52 AM.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,893

    Re: supplier based on price and quantity

    Hi. Me again. I was upgrading to O365 today and everything died.... So, eventually!!

    Lowest price (obviously)...
    =MIN(B2:F2)

    Highest Q @ lowest price:
    =LARGE(IF($B$2:$F$2=B5,$B$3:$F$3),1)

    Supplier @ highest Q and lowest price:
    =INDEX($B$1:$F$1,MATCH(1,(($B$2:$F$2=B5)*($B$3:$F$3=B6)),0))

    If others are NOT using O365, the last two are array formula and must be committed with CTRL-SHIFT-ENTER to insert {} round the formula.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-27-2020
    Location
    Lithuania
    MS-Off Ver
    Office 365
    Posts
    5

    Re: supplier based on price and quantity

    OMG!
    it works!, I have no idea how, but it works, now I will have some time to stare and think about the formula
    I spent over 8 hours on this and it had no idea how

    Thank you!

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,893

    Re: supplier based on price and quantity

    Enjoy your staring!! If you need an explanation... shout!

    If not then...

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  7. #7
    Registered User
    Join Date
    11-27-2020
    Location
    Lithuania
    MS-Off Ver
    Office 365
    Posts
    5

    Re: supplier based on price and quantity

    I just don't get this part ($B$2:$F$2=B5)*($B$3:$F$3=B6)
    we are getting true or false, but we also multiply the true or false?

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: supplier based on price and quantity

    Correct. So, TRUE = 1, FALSE = 0, so if you have two TRUES, that's 1 x 1 which equals 1 (i.e. both conditions are met). Only results that meet both criteria will be included, because the rest will equate to 0.

    Does this help?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Registered User
    Join Date
    11-27-2020
    Location
    Lithuania
    MS-Off Ver
    Office 365
    Posts
    5

    Re: supplier based on price and quantity

    yes, this makes perfect sense now

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,893

    Re: supplier based on price and quantity

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. [SOLVED] Sum quantity and price based on first 2 characters
    By gan_xl in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-05-2018, 06:12 AM
  2. How Do I Capture Which Price to Charge Based on Quantity Sold
    By EdwardSnowden in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-09-2018, 04:06 PM
  3. [SOLVED] Setting a selling price based on cost price and order quantity
    By Steven811 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-11-2014, 08:07 AM
  4. Replies: 5
    Last Post: 08-10-2011, 05:06 PM
  5. Searching applicable price based on various quantity
    By Umer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-25-2009, 01:48 PM
  6. Calculate price based on quantity
    By DieselNash in forum Excel General
    Replies: 5
    Last Post: 04-21-2009, 10:51 AM
  7. Summing Total Sales, Based on Quantity & Price
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-28-2005, 11:08 AM

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