+ Reply to Thread
Results 1 to 19 of 19

Return lowest price, based on multiple stock info

  1. #1
    Registered User
    Join Date
    11-12-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    29

    Return lowest price, based on multiple stock info

    Hi all,
    I am trying to make a formula in Excel but it's really causing lots of headache.

    The case:
    I have 3 "sets" of values with price and stock respectively.
    Column A: Price, supplier 1
    Column B: Stock, supplier 1

    Column C: Price, supplier 1
    Column D: Stock, supplier 1

    Column E: Price, supplier 1
    Column F: Stock, supplier 1

    So far I fixed the general minimum price (=min(A2,C2,E2) and it's working fine.

    What I need now is a formula that will look at the 3 stock values (B, D and F) and return the lowest price of the "set" that has more than 0,5 in stock (ie. B is 0, D is 5 and F is 0 - return C as price / B is 2, D is 5, F is 0 - return lowest price of B or D).
    My guess is that the part of the first formula, if using IF should be: =IF(AND(B2>0,5,D2>0,5,F2>0,5);G2) - Right?

    I hope it makes sense.

    (By the way, this formula didn't work: =IF(AND(B2>0,5,D2>0,5,F2>0,5),G2,IF(B2>0,5,A2,C2))

  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: Return lowest price, based on multiple stock info

    maybe this... {=MIN(IF(B2:F2>0,B2:F2))}
    Notice it is an array formula so you paste =MIN(IF(B2:F2>0,B2:F2)) into a cell then while in the function bar activate it by clicking on ctrl alt enter at the same time so the {} appear on either end of it. You cannot put those around it.

    Oh, and not sure but you may need to replace commas with semicolons depending on your settings.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Return lowest price, based on multiple stock info

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). 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 then scroll down to Manage Attachments to open the upload window.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    11-12-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    29

    Re: Return lowest price, based on multiple stock info

    Quote Originally Posted by Sambo kid View Post
    maybe this... {=MIN(IF(B2:F2>0,B2:F2))}
    Notice it is an array formula so you paste =MIN(IF(B2:F2>0,B2:F2)) into a cell then while in the function bar activate it by clicking on ctrl alt enter at the same time so the {} appear on either end of it. You cannot put those around it.

    Oh, and not sure but you may need to replace commas with semicolons depending on your settings.
    Hi Sambo. Thanks for the tip but it didn't give the result I wanted. It showed the value of the stock and not the price.
    I have attached my sheet.
    *By the way, CTRL ALT Enter did not work for me. However, CTRL SHIFT Enter did...
    Last edited by Brian.Romer; 11-13-2019 at 03:24 AM.

  5. #5
    Registered User
    Join Date
    11-12-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    29

    Re: Return lowest price, based on multiple stock info

    Quote Originally Posted by mehmetcik View Post
    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). 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 then scroll down to Manage Attachments to open the upload window.
    Hi Mehmet. File attached now.

  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: Return lowest price, based on multiple stock info

    sorry about the alt, yes it is ctrl shift enter.
    But there is no attachment. Did you follow the banner at the top's instructions?

  7. #7
    Registered User
    Join Date
    11-12-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    29

    Re: Return lowest price, based on multiple stock info

    Here it is.
    Attached Files Attached Files

  8. #8
    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: Return lowest price, based on multiple stock info

    how many of these price/stock will you have? Your example shows 3 but how many realistically can there be?

  9. #9
    Registered User
    Join Date
    11-12-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    29

    Re: Return lowest price, based on multiple stock info

    Quote Originally Posted by Sambo kid View Post
    how many of these price/stock will you have? Your example shows 3 but how many realistically can there be?
    Probably just the 3...might be 4 or 5 but that is not in the loop at the moment.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,543

    Re: Return lowest price, based on multiple stock info

    Very similar to Sam's formula, however since you are using the 365 version you only need to confirm by pressing the enter key: =MINIFS(A2:E2,A1:E1,"Price*",B2:F2,">=0.5")
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  11. #11
    Registered User
    Join Date
    11-12-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    29

    Re: Return lowest price, based on multiple stock info

    Quote Originally Posted by JeteMc View Post
    Very similar to Sam's formula, however since you are using the 365 version you only need to confirm by pressing the enter key: =MINIFS(A2:E2,A1:E1,"Price*",B2:F2,">=0.5")
    Let us know if you have any questions.
    Hi JeTeMc,
    Thanks. It worked.
    I suppose it is possible to use "*" in front of Price as well to wild card search if there is text in front of the "price" text?


    Edit:
    When using this on our remote desktop I realize that our remote server is using Excel 2016 Any ways to use the same formula in Excel 2016? It works even with "*" in front of "Price" in my Excel 36´5, but I get a False error on the server with Excel 2016
    Last edited by Brian.Romer; 11-15-2019 at 03:43 PM.

  12. #12
    Registered User
    Join Date
    11-12-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    29

    Re: Return lowest price, based on multiple stock info

    Hi again,
    In addition, I have another problem with the formula:
    When I copy/Paste (as values) from a data sheet and in to the Price stock fields, I get only "0" in value in the entire Min. Stock price column.
    Also, another issue: I need blank cells to be ignored. So if a Price and/or stock cell is blank (no values), it need to be counted as Zero or ignored if possible.

    And as stated earlier, it doesn't work on our remote desktop using Excel 2016.

  13. #13
    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: Return lowest price, based on multiple stock info

    I can get there with this array if I use max...
    =MAX(IF((LEFT(A1:F1,5)="Price")*(A2:F2>0),A2:F2))
    (ctrl/shift/enter)

    Can't address the copy/paste issue as it works for me no matter which formula I use.
    Last edited by Sam Capricci; 11-15-2019 at 04:55 PM.

  14. #14
    Registered User
    Join Date
    11-12-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    29

    Re: Return lowest price, based on multiple stock info

    Quote Originally Posted by Sambo kid View Post
    I can get there with this array if I use max...
    =MAX(IF((LEFT(A1:F1,5)="Price")*(A2:F2>0),A2:F2))
    (ctrl/shift/enter)

    Can't address the copy/paste issue as it works for me no matter which formula I use.
    That didn't work at all. Even with price 1 being 100 and no stock it was selected.
    But thanks for the reply

  15. #15
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,543

    Re: Return lowest price, based on multiple stock info

    MINIFS is supported by the 2019 and 365 versions, so we will not be able to use it.
    Wildcards can only be used with certain functions, not including MIN or IF.
    One solution might be to use the following array entered formula*: =MIN(IF(ISNUMBER(SEARCH("Price",A1:E1)),IF(B2:F2>0,A2:E2)))
    * See post #6.
    Let us know if you have any questions.

  16. #16
    Registered User
    Join Date
    11-12-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    29

    Re: Return lowest price, based on multiple stock info

    Quote Originally Posted by JeteMc View Post
    MINIFS is supported by the 2019 and 365 versions, so we will not be able to use it.
    Wildcards can only be used with certain functions, not including MIN or IF.
    One solution might be to use the following array entered formula*: =MIN(IF(ISNUMBER(SEARCH("Price",A1:E1)),IF(B2:F2>0,A2:E2)))
    * See post #6.
    Let us know if you have any questions.
    Hi there,
    It worked like a charm as soon as I locked top row ($A$1:$E$1). Now working on both platforms.
    Thanks a lot for the help

  17. #17
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,543

    Re: Return lowest price, based on multiple stock info

    You're Welcome. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

  18. #18
    Registered User
    Join Date
    05-14-2021
    Location
    South Africa
    MS-Off Ver
    365
    Posts
    1

    Re: Return lowest price, based on multiple stock info

    Hi guys, really hoping I don't get shamed for replying on this thread 2 years later. This post helped me not lose my mind as I could finally sort out an issue I had.
    I do however sit with a problem where, referencing to the example sheet Brian attached, when all suppliers are out of stock the formula outputs 0. Is there a way I can alter the formula that should no supplier have stock that it still outputs the MIN of all prices, but should one supplier suddenly have stock that it goes through the initial formula? I see in the example sheet that there is a separate column for that but I would like to keep it in the same column.

    Any advice would be appreciated and sorry again for re-opening this thread.

  19. #19
    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: Return lowest price, based on multiple stock info

    danny, welcome to the forum. Please check the rules, particularly #4... 4. Do not post a new help request in an existing thread.
    please start your own post, you can copy the link to this thread if you think the information in this post is important.
    AND it is always helpful to upload a workbook per the instructions in the yellow banner at the top of the post to get the best help.
    Just remember, to open a new post doesn't cost anything AND any resolutions offered will be specific to your needs.

+ 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. Macro to lookup and return lowest product price from specific website
    By timmy1254 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-13-2014, 12:02 AM
  2. Need to Return Lowest Price based on Criteria
    By BYizz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-23-2013, 01:03 PM
  3. Replies: 3
    Last Post: 01-03-2013, 12:32 AM
  4. Replies: 0
    Last Post: 10-28-2012, 07:22 AM
  5. [SOLVED] Formula Needed that will return a Supliers Lowest Total Price
    By LisaG in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-02-2012, 12:39 PM
  6. Return the lowest price and supplier
    By Xhelp in forum Excel General
    Replies: 2
    Last Post: 10-25-2011, 04:10 AM
  7. Return Price Based on Multiple Criteria
    By tigabalm in forum Excel General
    Replies: 2
    Last Post: 06-08-2011, 12:05 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