View Single Post
  #8   Report Post  
nastech
 
Posts: n/a
Default Formula for: Format Decimal places?


How about this approach: In one cell display, for example, the first three
significant digits of your # of shares; and in the adjacent cell display the
multiplier. In other words, you are computing the divisor based on the number
of shares, rather than entering it manually.

To be consistent with what you wrote earlier, we will express the results as a
number followed by two decimals.

I'll use A1 for the "real number" of shares to buy; B1 for the first three
significant digits / 100; and C1 for the multiplier. You can then adapt that
to your layout.

For example, you compute to purchase 999 shares;

A1: 999
B1: 999
C1: 1

A1: 5048
B1: 5.04
C1: 1,000

A1: 21253
B1: 2.12
C1: 10,000

To do the above, you can use the formulas:

B1: =TRUNC(A1,2-INT(LOG10(A1)))/10^INT(LOG10(A1))
C1: =10^INT(LOG10(A1))

Formats:

B1: Format/Cells/Custom/Type: 0.00
C1: Format/Cells/Custom/Type: #,##0



Result is for # of shares to BUY.


Think I am getting it more by looking at it.. but wonder if can combine the
eq's.. if greater than, etc.. but would need to see if there is an eq for
entering format in cell, for B1: C1: Format/Cells/Custom/Type above
does that exist?