home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / discs / gerald / 7_02 / 9311 / BestShop / ReadMe next >
Text File  |  1993-09-25  |  3KB  |  59 lines

  1. %OP%VS4.13 (28-Apr-92), Gerald L Fitton, R4000 5966 9904 9938 
  2. %OP%DP0
  3. %OP%IRY
  4. %OP%PL0
  5. %OP%HM0
  6. %OP%FM0
  7. %OP%BM0
  8. %OP%LM4
  9. %OP%PT1
  10. %OP%PDPipeLine
  11. %OP%WC1026,2262,188,1748,0,0,0,0
  12. %CO:A,72,72%
  13. %C%Selecting a Maximum or Minimum
  14. %C%by Gerald L Fitton & Denis Murray-Smith
  15. Keywords:
  16. BestShop Murray-Smith Fitton
  17.  
  18. It was Denis Murray-Smith who first put this problem to me in the 
  19. context of finding the best shop in which to buy a particular item when 
  20. you know the prices of the items in each of many shops.  However, the 
  21. problem is of wider significance, for example, you may wish to find out 
  22. which of many subjects are best for each pupil and then find out which 
  23. subject is best received!
  24.  
  25. Load the file [Shopping].  The names of the products appear in column A 
  26. as Alpha, Beta, Gamma and Delta.  The names of the shops appear in row 
  27. 6 as Shopá1, Shopá2, Shopá3 and Shopá4.  Of course you could have many 
  28. more items and a much greater choice of shops; I wanted to ensure that 
  29. the whole file fitted neatly across the screen and didn't take up too 
  30. much disc space.
  31.  
  32. Data (prices) is entered in the block B8E11.  Column F contains a 
  33. formula which calculates the cheapest price for the item in each row.  
  34. Column G contains a formula which returns the name of the shop having 
  35. the lowest price.
  36.  
  37. The price of each of the four items in each of the four shops appears 
  38. in the range of slots B8E11.  The formula in slot F8 is min(B8E8), and 
  39. it returns the lowest price in row B.
  40.  
  41. The slot G8 contains the formula lookup(F8,B8E8,B$6E$6).  The arguments 
  42. of the lookup(,,) formula are:  F8 - the key field containing the 
  43. minimum price, B8E8 - the range in which you hope to find F8 (the 
  44. minimum price), B$6E$6 - the range which contains the value to be 
  45. returned.  Note the $ characters in this last range; these ensue that, 
  46. as you replicate the formula from G8 down through the column G, the 
  47. final argument of the lookup(,,) function does not change.  For 
  48. example, in the slot G11 you will find lookup(F11,B8B11,B$6E$6).
  49.  
  50. The formulae in F8 and G8 have been replicated down the two columns 
  51. using the following technique.  Place the cursor in F8 and execute 
  52. <CtrláZ> to mark slot F8.  Place the cursor in G11 and execute <CtrláZ> 
  53. so that the 'block' F8G11 is marked.  Alternatively drag from F8 to G11 
  54. to mark F8G11.  Execute <CtrláBRD> to replicate the formula down 
  55. through the marked block.  You can extend the formulae down as many 
  56. rows as you wish.
  57.  
  58. Please let me know if you find this simple sort of spreadsheet useful.
  59.