quietcobra21 said:Actually, column C is the initial price Peter offered, and D is his final price. Column E shows Mark's initial offer, while F is Mark's final price. Basically, the spreadsheet identifies which bidder gave the lowest price, puts that value in column G, and then calculates the ratio of the initial price to the final price for whichever bidder was cheaper—and it doesn't have to be the same person for every item. For apples, Mark was cheaper; for pears, it was Peter; and for plums, we're back to Mark.
How do I pull this off? Help?
No, wait, did you try using a formula yet?
Look, if you don't care about keeping a strict structure—like, if the lowest price could just be any cell belonging to a specific user—you can actually handle this entire thing using MIN and MAX functions.
- finding the lowest price
Code:
=MIN(D2:G2)
- this grabs all the values, both starting and final prices.
- calculating the index
Code:
=IF(AND(MIN(D2:E2)=H2;MIN(F2:G2)=H2);H2/MAX(D2:G2);IF(MIN(D2:E2)=H2;H2/MAX(D2:E2);H2/MAX(F2:G2)))
- if both people submitted the exact same lowest price, the index is the lowest price divided by the highest price; if they aren't the same, then
- if the first person has the lowest price (regardless of whether it was their start or end price), the index is the lowest price divided by their own highest price; otherwise
- the index is the lowest price divided by the second person's highest price.
☕