home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / pg / pggene / srom14.tip < prev    next >
Text File  |  2006-10-19  |  3KB  |  82 lines

  1. SuperROM Tip #14 by Paul Globman
  2.     Copyright (c) 1986, 1990
  3. --------------------------------
  4. Successful spreadsheet analysis usually requires a certain amount of decision
  5. making.  Unfortunately, SuperROM does not support...
  6.  
  7.    IF... THEN... ELSE (IF)
  8.  
  9. They offer an example on page 74 of the Lucid manual as follows:
  10.  
  11. Suppose you need to calculate the price of a service that was priced at $10 per
  12. hour, but had a 4 hour minimum.
  13.  
  14. The Lucid manual goes on to offer a solution that requires the use of a lookup
  15. table.  This may be the only way to accomplish this task with the Lucid ROM,
  16. but with SuperROM the technique is quite different.
  17.  
  18. I have spent a fair amount of time learning the SuperROM and would like to 
  19. report that I am able to perform...
  20.  
  21.         IF...THEN...ELSE 
  22.  
  23. ...decisions within a single cell of LUCID, without having to refer to any
  24. outside table (TBL).
  25.  
  26. This comes from the use of RELATIONAL OPERATORS, which the LUCID manual does
  27. not discuss.  The LUCID DATABASE manual discusses (very) briefly the use of 
  28. relational operators for criteria selection in the 'report definition block'
  29. for output.
  30.  
  31. Relational operators can be used in any cell to obtain a TRUE(-1) or a FALSE(0)
  32. value and when multiplied by -1 yeilds some fantastic options. Please note
  33. examples:
  34.  
  35. A1 = number of hours worked on a job.
  36. Minimum charge is for 4 hours.
  37. B1 = billable hours
  38.  
  39. The formula for cell B1 is:
  40.  
  41.        -(A1<=4)*4-(A1>4)*A1
  42.  
  43.  The first '-' is equal to 'IF' 
  44.        the '*' is equal to 'THEN'
  45.  Additional '-'s are read as 'ELSE IF'
  46.  
  47. So the above example is:
  48.  
  49.  IF A1<=4 THEN 4 ELSE IF A1>4 THEN A1
  50.  
  51. If the first IF is false the cell value will be zero unless an ELSE IF is 
  52. included.
  53.  
  54. Now enter some data in cell A1 and watch the results.   Cell B1 will display 
  55. the number of hours billed.  Multiply B1 by the hourly rate ($10) and you get 
  56. the amount billed.
  57.  
  58. Pretty POWERFUL indeed!! This formula is the essence of the decision making 
  59. processes in some financial spreadsheets.  
  60.  
  61. This can be used for tax calculations like:
  62.  
  63. IF deductions > 3000 THEN display deductions - 3000 ELSE display 0.  (A6=total deductions)
  64.  
  65. NEW CELL FORMULA: -(A6>3000)*(A6-3000)
  66.  
  67.  
  68. Or how about applying 5% discount on total sales (A5) exceeding $20...
  69.  
  70. NEW CELL FORMULA:+A5+(A5>20)*(.05*A5)
  71.  
  72.  
  73. (NEW CELL is another cell, ex:cell B1)
  74.  
  75. I developed this aspect of SuperROMs use of relational operators in June 1986.
  76. I informed PCSG back then, hoping to find a way of enlightening other SuperROM
  77. users.  I hope some of you M100SIG users can make adequate use of this info.
  78.  
  79.  
  80. Paul Globman [72227,1661]
  81.  
  82.