home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / discs / gerald / 7_08 / Lookup / ReadMe next >
Text File  |  1994-03-26  |  5KB  |  51 lines

  1. {Version:1.07;11 Nov 1993;Fireworkz;Gerald Lewis Fitton;6500 1045 8323 3131}
  2. {Block:0;0;;32;1;18;;32;1;18}
  3. {Style:ZLBase;{StyleKey:^F1}{ColWidth:11055}{ColName:#}{RowHeight:0}{RowHeightFix:0}{RowUnbreakable:1}{RowName:#}{MarginLeft:1134}{MarginRight:850}{MarginPara:0}{Tablist}{Background:255;255;255}{ParaStart:0}{ParaEnd:288}{LineSpace:0;72}{Justify:3}{NewObject:3}{Numform:#,##0.00}{NumformDT:dd.mm.yy}{NumformSE:@}{BorderColour:0;187;255}{Border:0}{GridLeftColour:0;187;255}{GridTopColour:0;187;255}{GridRightColour:0;187;255}{GridBottomColour:0;187;255}{GridLeft:0}{GridTop:0}{GridRight:0}{GridBottom:0}{Typeface:Times}{Fontx:0}{Fonty:240}{Underline:0}{Bold:0}{Italic:0}{Superscript:0}{Subscript:0}{Foreground:0;0;0}}
  4. {StyleBase:ZLBase}
  5. {Style:ZLHeadFoot}
  6. {StyleHeaderFooter:ZLHeadFoot}
  7. {Style:ZLHeading;{StyleKey:^F2}{LineSpace:0;72}{Justify:1}{Fonty:320}{Bold:1}{Italic:1}}
  8. {Style:ZLSubHead;{StyleKey:^F4}{ParaStart:289}{Typeface:Helvetica}{Bold:1}}
  9. {Style:ZLByLine;{StyleKey:^F3}{Fonty:280}}
  10. {Style:ZLKeywords;{MarginLeft:2268}{MarginPara:-1133}{Tablist:L0}{Italic:1}}
  11. {Style:ZL FileName;{StyleKey:^F5}{Italic:1}}
  12. {Paper:From Printer;0;16839;11907;737;284;284;284;0;0;0;0;16;;0}
  13. {PaperScale:100}
  14. {PrintQuality:0}
  15. {StartOfData}
  16. {S:X;X;0;0;The Fireworkz lookup(,,) function{ITR-X}by Gerald L Fitton}
  17. {S:X;X;0;1;It was Denis Murray-Smith who first put to me the problem of finding the column heading of the column containing the minimum value for that row.  His problem was that of finding the best shop in which to buy a particular item when you know the prices of the items in each of many shops.  The general problem is of wider application, for example, you may wish to find out which of many subjects are best for each pupil and then go on to find out which subject is best received!  One of my correspondents now uses a slight variant of this application to check which of many types of investment is 'best' for her.}
  18. {S:X;X;0;2;In the Novemberá1993 edition of Archive I gave details of my PipeDream 'solution' to this problem.  I expected to 'port' that solution to Fireworkz but, when I 'ported' the PipeDream file to Versioná1.07 of Fireworkz it didn't work for the reason I describe below.}
  19. {S:X;X;0;3;Although I have received a score of letters asking for details of a similar application for use with Fireworkz I have delayed describing a 'work around' believing that Versioná1.08 was 'just around the corner' and that the PipeDream application would 'port' across to Versioná1.08 and 'work' first time.  However, so many of you have asked me how to get lookup(,,) to 'work' in Vá1.07 that I have decided to explain the 'work around'.}
  20. {S:X;X;0;4;The screenshot below, figureá1, shows a simple spreadsheet which I've called [Shopping].  The names of the products appear in column a as Alpha, Beta, Gamma and Delta.  The names of the shops appear in row 6 as Shopá1, Shopá2, Shopá3 and Shopá4.  Of course you could have many more items and a much greater choice of shops.}
  21. {S:X;X;0;5;Data (prices) is entered in the block b8e11.  Column f contains a formula which calculates the cheapest price for the item in each row.  Column g contains a formula which returns the name of the shop having the lowest price.}
  22. {S:X;X;0;6;The price of each of the four items in each of the four shops appears in the range of slots b8e11.  The formula in slot f8 is min(b8e8), and it returns the lowest price in row 8.}
  23. {S:X;X;0;7;The slot g8 contains the formula}
  24. {S:X;X;0;8;lookup(f8,transpose(b8e8),transpose(b$6e$6)).}
  25. {S:X;X;0;9;The difference between the Fireworkz formula and the pipeDream formula is the use of the transpose() function.}
  26. {S:X;X;0;10;The arguments of the lookup(,,) formula are:}
  27. {S:X;X;0;11;f8 \ù the key field containing the minimum price}
  28. {S:X;X;0;12;b8e8 \ù the range in which you hope to find f8 (the minimum price)}
  29. {S:X;X;0;13;b$6e$6 \ù the range which contains the value to be returned (the shop).}
  30. {S:X;X;0;14;Note the $ characters in this last range\\\; these ensue that, as you replicate the formula from g8 down through the column g (see below), the final argument of the lookup(,,) function does not change.}
  31. {S:X;X;0;15;For example, in the slot g11 you will find lookup(f11,transpose(b8b11),transpose(b$6e$6)).}
  32. {S:X;X;0;16;When you 'port' the PipeDream version (which doesn't have the transpose function) to Fireworkz it doesn't work.  It seems that, in Fireworkz, lookup(,,) works only with \Évertical\æ arrays.  The 'work around' is to include the transpose() function as I have in this example.}
  33. {S:X;X;0;17;The formulae in f8 and g8 have been replicated down the two columns using the following technique.  Place the cursor in f8 and drag from f8 to g11 to mark the block f8g11.  Click on the fill down button which is at the top left of the first button bar.  You can extend the formulae down as many rows as you wish.}
  34. {BR:;;;;;;;;1;1;{StyleHandle:ZLBase}}
  35. {BR:;;;;;;;;1;1;{ColWidth:0}}
  36. {BR:0;;;;1;;;;1;0;{StyleHandle:ZLBase}}
  37. {R:0;0;;32;1;1;;32;0;0;{StyleHandle:ZLHeading}}
  38. {R:0;0;39;3;1;1;;32;0;0;{StyleHandle:ZLByLine}}
  39. {PageHefoBreakValues-H:0;0;0;;1;396;0;0;;;0;;;1;0;228;0;;;0}
  40. {HD-H:0;2}
  41. {HBR-H:0;2;;32;;32;{StyleHandle:ZLBase}}
  42. {HBR-H:0;2;;32;;32;{StyleHandle:ZLHeadFoot}}
  43. {HD-H:0;3}
  44. {HBR-H:0;3;;32;;32;{StyleHandle:ZLBase}}
  45. {HBR-H:0;3;;32;;32;{StyleHandle:ZLHeadFoot}}
  46. {EndOfData}
  47. {CmdGroup:{ViewCreate:5920;13984;12480;13952}
  48. {ViewControl:100;0;1;1;0;0;0;2048;0;2048}
  49. {CurrentPosition:0;0;0;3}
  50. }
  51.