patcannon
  Log In  |  Create a FREE Account  |  Everyone's Spreadsheets  |  Tags  |  Help  
 Saving... 
  login to save   undo redo  |  bold italic font text underline more font formatting  |  align left align center align right  |  text color background text color  |  sum hide/show tools
  fx
NotesDateOdometerGallonsPaidMiles, This FillMiles/Gal, This Fill$/Gal, This Fill$/Mile, This Fill
$/Mile, This Fill
Miles, TotalGallons, TotalMiles/gal, Total$ Total
Holiday, Plymouth9/29/052035505.88116.23
$16.23
=E2/D2
$2.76
#VALUE!
Holiday, Plymouth10/2/052036724.07011.64
$11.64
12229.98=E3/D3
$2.86
=E3/F3
$0.10
=SUM(M2:M2)
$0.00
Holiday, Hiawatha10/8/052039449.25124.97
$24.97
27229.40=E4/D4
$2.70
=E4/F4
$0.09
39413.32129.58
Holiday, Hiawatha10/12/052041135.39714.03
$14.03
16931.31=E5/D5
$2.60
=E5/F5
$0.08
56318.71830.08
Holiday, Hiawatha10/14/052042193.9509.87
$9.87
10626.84=E6/D6
$2.50
=E6/F6
$0.09
66922.66829.51
Holiday, Plymouth -- ODOMETER ESTIMATED10/17/052043855.47112.96
$12.96
16630.34=E7/D7
$2.37
=E7/F7
$0.08
83528.13929.67
Holiday, Hiawatha10/20/052045104.29110.21
$10.21
12529.13=E8/D8
$2.38
=E8/F8
$0.08
96032.4329.60
Holiday, Hiawatha10/24/052047217.81717.35
$17.35
21126.99=E9/D9
$2.22
=E9/F9
$0.08
117140.24729.10
Holiday, Plymouth10/28/052049086.24813.43
$13.43
18729.93=E10/D10
$2.15
=E10/F10
$0.07
135846.49529.21
Holiday, Hiawatha11/2/052051418.05617.23
$17.23
23328.92=E11/D11
$2.14
=E11/F11
$0.07
159154.55099999999999529.17
-205141-In,fin,ity.00=E12/D12
$0.00
=E12/F12
$0.00
-20355054.550999999999995-3,731.37
 
Average Rating:  Not rated (Not yet rated)
 
Name:  Saturn Gas Mileage by  patcannon patcannon 
Description:  Gas mileage of my '93 Saturn SW1 wagon.
Tags:  gas car mileage AppleScript  

Comments:

relative refs
Here is my re-invention of the wheel, for those on Macs. It lets you do a basic 'fill down' or 'fill across' for VERY simple formulas. I used this, then a search-replace in BBEdit to add fancy stuff like FIXED() or whatever. -- start AppleScript (you'll have replace th <br>'s with returns)" -----------<br> display dialog "This script is to create some the effect of a relative cell reference for Numsum.com, which doesn't have it yet." & return & return & "It works, for VERY simple formulas, by creating a list of formulas separated by returns (to fill down) or tabs (to fill to the right). When you paste the list into the first cell, it populates the bunch of them."<br> <br> set f1 to text returned of (display dialog "Enter (or better yet, paste) the formula for your first cell:" default answer "")<br> display dialog "How many cells (including your starting cell) do you want to fill?" buttons {"Cancel", "Horizontal", "Vertical"} default answer "" default button 3<br> set {cellsToFill, stepDirection} to {text returned of the result, button returned of the result}<br> <br> if stepDirection is "Vertical" then<br> set cellSep to return<br> else<br> set cellSep to tab<br> end if<br> <br> considering case<br> set capAlpha to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"<br> <br> set parsedFormula to {} -- example for "=F2/C2": {"=", "F2", "/", "C2"}<br> set cellFlagList to {} -- {false, true, false, true}<br> set thisItem to ""<br> set cellFlag to false<br> set k to 1<br> repeat while k ≤ length of f1<br> if character k of f1 is in capAlpha then<br> --Big fat assumptions here:<br> -- • All capital letters signify the start of a cell reference. This obviously fails when the formula contains functions like FIXED<br> -- • All cell references are 2 characters (i.e. nobody will expect this to work starting in any cell further out than Z9)<br> set cellFlag to true<br> set thisItem to text k through (k + 1) of f1<br> set k to k + 1<br> else<br> set cellFlag to false<br> set thisItem to character k of f1<br> end if<br> copy thisItem to end of parsedFormula<br> copy cellFlag to end of cellFlagList<br> set k to k + 1<br> end repeat<br> end considering<br> <br> set fOld to f1<br> set fString to fOld<br> repeat with addMe from 1 to cellsToFill<br> set fNew to ""<br> repeat with n from 1 to (length of parsedFormula)<br> set thisPiece to item n of parsedFormula<br> set cellFlag to item n of cellFlagList<br> if cellFlag is false then<br> set fNew to fNew & thisPiece<br> else<br> set fNew to fNew & incrementCell(thisPiece, addMe, "Vertical")<br> end if<br> end repeat<br> set fString to fString & cellSep & fNew<br> set fOld to fNew<br> end repeat<br> <br> set the clipboard to text of fString<br> display dialog "The clipboard now contains:" & return & return & fString & return & return & "You can paste this into the same cell you copied the initial formula from." buttons {"Cool."} default button 1<br> -------------------------------------------------------<br> to incrementCell(c, newCoord, HorV)<br> --Big fat assumption here:<br> --The number might have incremented past 9 but the letter won't go past Z.<br> set c1 to character 1 of c<br> if HorV is "Vertical" then -- change A1 to A2:<br> set c to c1 & (((text 2 through -1 of c) as integer) + newCoord)<br> else -- change A1 to B1:<br> set c1 to ASCII character of ((ASCII number of c1) + newCoord)<br> set c to c1 & (text 2 through -1 of c)<br> end if<br> return c<br> end incrementCell<br> -----------------------------------
2420 days ago 


relative refs
Hi, sorry, not yet on relative cell refs.
2429 days ago 


Add Comment
[ default color ]
 
 recent: