+ Reply to Thread
Results 1 to 17 of 17

Help comparing prices and returning with conditions

  1. #1
    Registered User
    Join Date
    03-25-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    9

    Help comparing prices and returning with conditions

    Hi!

    Needing some help on this sheet I am working on for quoting from vendors. As you'll see on the attached, my quotes get a little complex. I have multiple vendors, quoting different parts, at various price breaks.

    Right now I have the min price showing up for each quantity (5, 10, 20, etc.) in columns K:AD paired with the vendor that offers the part at the lowest price.

    That's all nice and dandy, but what I would really like is if column C could return the vendor if it is the same at each quantity for one part, and if they have in stock (D:J).

    Sure, you could say well, why don't you just go through and compare manually. Well, this one quote I'm about to get started on has 663 different parts, so it can be very time consuming without this tool.

    Optionally, I'd like to know what the formula would be to have the lowest price show up only if the part is in stock at that vendor, that way the prices shown are for parts in stock.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help comparing prices and returning with conditions

    Hi

    Can you please update your example file to show some actual results and explain why they calculated. From what I can see of the 2 examples, you won't get a result because you don't have a situation where all the vendors are the same (row 4), or the vendor that has all the parts (row 3 vendor4) has no stock (G3 = 0).

    rylo

  3. #3
    Registered User
    Join Date
    03-25-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help comparing prices and returning with conditions

    Thanks for helping me out. I've filled out some numbers. There should be scenarios where there is no stock for a vendor with lowest price, some where there is no stock for two vendors with lowest price, some where there is two lowest prices, three lowest prices.

    End result is I would like to be able to have returned the lowest priced vendor that has stock, or optionally just the lowest price vendor (sometimes I can accept the lead time) depending on what I am looking for. Two formulas would be ideal.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help comparing prices and returning with conditions

    Hi

    OK, here's a start.

    K3: =MIN(IF((D3:J3<>0)*(AE3:AK3<>0),AE3:AK3,999))
    L3: =INDEX($1:$1,MIN(IF((D3:J3<>0)*(AE3:AK3=K3),COLUMN(AE3:AK3),999)))
    Both these formulas are array entered.

    This should give you the lowest price for a vendor with stock, and bring back the first relevant vendor (if there is more than 1 candidate).

    See how it goes and let me know.

    rylo

  5. #5
    Registered User
    Join Date
    03-25-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help comparing prices and returning with conditions

    This works great thank you! Is there a way we could make one modification? What would I need to add so that it tells me there are multiple vendors with the same lowest price?

    EDIT: Also, will this work if I filter and sort my data?
    Last edited by SpiffyMasta; 03-27-2013 at 11:21 AM.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help comparing prices and returning with conditions

    Hi

    Here's one way. It will put the number of vendors with that price after the vendor. It doesn't distinguish between vendors with stock, or vendors without stock, just a vendor with that price.

    L3: =INDEX($1:$1,MIN(IF((D3:J3<>0)*(AE3:AK3=K3),COLUMN(AE3:AK3),999))) & " (" & COUNTIF(AE3:AK3,K3) & ")" (Array entered of course)

    Filter: think so, but would have to know exactly what you are filtering and where to test it out.

    rylo

  7. #7
    Registered User
    Join Date
    03-25-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help comparing prices and returning with conditions

    Works great! Thanks.

    One last item I believe I need. How can I get supplier column C to show the vendor or vendors that have the best price(s) across the row?

    I.E. line 1 would say Vendor1 line 2 would say Vendor4 Vendor2 Vendor 6 line 3 Vendor2

  8. #8
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help comparing prices and returning with conditions

    Hi

    Easiest way to do that is to build your own function. Are you able to have a macro in the file? Some organisations don't allow macros to be actioned.

    rylo

  9. #9
    Registered User
    Join Date
    03-25-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help comparing prices and returning with conditions

    Macros are not an issue.

  10. #10
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help comparing prices and returning with conditions

    Hi

    OK using the example file from #3, the K3 formula from #4 and the L3 formula from #6 then do

    Insert the following code into a general module in the workbook.
    Please Login or Register  to view this content.
    Invoke the function.
    C3: =myfunc(K3,AE3:AK3)

    Copy down all the relevant formulas to row 19. You should find a comma separated list of the relevant vendors in column C

    Remember that you will have to save the file as a .xlsm (macro file).

    rylo

  11. #11
    Registered User
    Join Date
    03-25-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help comparing prices and returning with conditions

    Great, everything works. Now, I have made one slight modification. I removed (D3:J3<>0)* and ,999 from K3 and L3 formulas so that if the vendor has no stock, it still gives me the best price. Is this the correct way to go about it?

    After making this change, if I have no vendors with stock or pricing, Vendor1 shows up in the min price vendor column, and all vendors show up in the C (now F) column.

    I've attached the new file. Is there an easy way to fix this?

    EDIT: So after taking a good look at it, there's an issue. If you look at the file, you'll notice row 4 has vendor4 as best price for qty 5, vendor2 as best for qty 10 and 500, vendor5 as best for 20, 50, 75, 100 and vendor 6 as best for qty 250. I need my supplier column to show all of these vendors as well as the ones that might not show up in O3:AG:19 like the current code does.
    Attached Files Attached Files
    Last edited by SpiffyMasta; 04-02-2013 at 01:49 PM.

  12. #12
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help comparing prices and returning with conditions

    Hi

    1) not stock question - good enough, though this is a change from the original brief.
    2) Put in an IF statement, so that if min price is 0, then result is "" else do the formula. O10: =IF(N10=0,"",INDEX($1:$1,MIN(IF((AH10:AN10=N10),COLUMN(AH10:AN10)))) & " (" & COUNTIF(AH10:AN10,N10) & ")")

    3) concatenate the results from the individual myfunc functions. F3: =myfunc(N3,AH3:AN3)&", "&myfunc(P3,AO3:AU3) and so on...

    rylo

  13. #13
    Registered User
    Join Date
    03-25-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help comparing prices and returning with conditions

    Rylo, the problem if I concatenate is that I get 10 times the same vendor in F, I only want each vendor to show once.

    Also in F10, each vendor now shows up ten times lol. Attached new file for you to take a look.
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help comparing prices and returning with conditions

    Hi

    OK, try this

    Please Login or Register  to view this content.
    Using your example file, F3: =myfunc2(N3,AH3:AN3,P3,AO3:AU3,R3,AV3:BB3,T3,BC3:BI3,V3,BJ3:BP3,X3,BQ3:BW3,Z3,BX3:CD3,AB3,CE3:CK3,AD3,CL3:CR3,AF3,CS3:CY3)

    See how that goes.

    rylo

  15. #15
    Registered User
    Join Date
    03-25-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help comparing prices and returning with conditions

    Doesn't work... See line 2. Only Future and Avnet are shown, yet I would like to see Future, Avnet, Mouser and Newark.
    Attached Files Attached Files

  16. #16
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help comparing prices and returning with conditions

    Hi

    Oops, sorry. Forgot to complete the array of ranges to action after testing.

    Please Login or Register  to view this content.
    rylo

  17. #17
    Registered User
    Join Date
    03-25-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help comparing prices and returning with conditions

    Now we're talking!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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