Word Field Maths Tutorial (v1.4)

#1 User is offline macropod

  • Silver Lounger (over 1600 posts)
  • Group: Moderator
  • Posts: 2317
  • Joined: 2002-05-11
  • Location:Canberra, Australian Capital Territory, Australia

Attached is a document I've created to show how to do various mathematical calculations using Word fields, including some possibilities for string testing & manipulation. Topics covered include:

Formula Field Syntax
Formula Field Arithmetic Operators
Formula Field Comparison Operators
Formula Field Functions
Formula Field Logical Functions
. AND And OR: Testing Multiple Logical Numeric Expressions
. Testing Negative Numbers
. Testing Or Returning Text Strings With Logical Functions In Bookmarks
Calculations In Word Forms
Referencing Cells In A Table
. Identifying Cell Addresses
. Referencing Cells Containing Numbers
. Referencing Cells Containing Text
. Reference Operators
. Referencing An Entire Row Or Column
. Referencing Adjacent Cells In A Row Or Column
. Relative Referencing In Tables
. Testing Or Returning Cell Contents In Tables
. Reference Table Cells From Outside The Table
. Referencing Row And Column Totals From Outside A Table
Formatting Numeric Field Results
Rounding Numbers To The Nearest Multiple
Rounding Numbers Up Or Down
Superscripted Ordinal Numbers
Parse Numbers Separated By + Or - Signs
Scientific Notation
Logarithms
Trigonometry
Calculate Horizon Distances Using Word Fields
Financial Calculations


Feedback welcome,

Cheers

Attached file(s)



#2 User is offline TonyE

  • Platinum Lounger (over 3500 posts)
  • Group: Moderator
  • Posts: 3658
  • Joined: 2001-01-18

Thanks Macropod

Another excellent document with clear explanations and examples. This will be as useful as your date calculations document.

#3 User is offline AndrewO

  • 5-Star Lounger (over 600 posts)
  • Group: Member
  • Posts: 622
  • Joined: 2002-10-03
  • Location:Wellington, Wellington, New Zealand

... and in your spare time? ...
Another great post. Thanks.

#4 User is offline Phil Rabichow

  • Uranium Lounger (over 6000 posts)
  • Group: Member
  • Posts: 7453
  • Joined: 2000-12-23
  • Location:Los Angeles Area, California, USA

Hi macropod:
This is great. bravo Very well explained. Two suggestions:
1. p. 3 you left out a closing red bracket (you had "{=3+2" instead of "{=3+2}").
2. In the section on "Referencing Cells In A Table", you might point out that, although you can reference bookmarks in a table, those bookmark names should have at least 3 alpha characters if they end in a number. i.e. I used to name bookmarks bk1, bk2, etc. I learned the hard way that, in a table, you must use something like bmk1, bmk2. Word interprets bk1 as column bk, row 1.
Cheers,

#5 User is offline macropod

  • Silver Lounger (over 1600 posts)
  • Group: Moderator
  • Posts: 2317
  • Joined: 2002-05-11
  • Location:Canberra, Australian Capital Territory, Australia

Thanks Phil,

Updated to include both the correction and suggested comment re bookmarked tables. I've encountered that one on the odd occasion too, and it's not limited to purely alpha-numerics - other non-numeric characters followed by numbers sometimes get interpreted as cell references too.

Cheers

#6 User is offline StuartR

  • Plutonium Lounger (over 10K posts)
  • Group: Member
  • Posts: 11118
  • Joined: 2001-11-28
  • Location:Eileenslounge.com

> Feedback welcome,

That is truly awesome, thank you.

StuartR

#7 User is offline Slinky

  • Slinky
  • Group: Member
  • Posts: 85697
  • Joined: 2002-03-22

In one word: Wow!

#8 User is offline diegol

  • 5-Star Lounger (over 600 posts)
  • Group: Member
  • Posts: 885
  • Joined: 2002-03-18
  • Location:Buenos Aires, Argentina

It seems wonderfully crafted. I hope I'll get round to having a more detailed look at it.
Keep it up!! thumbup

#9 User is offline AlanMiller

  • Platinum Lounger (over 3500 posts)
  • Group: VIP
  • Posts: 5772
  • Joined: 2001-11-06
  • Location:Melbourne, Victoria, Australia

Many thanks Macropod. This appears to contain some very clever stuff.

Alan

#10 User is offline tlc@frontier.net

  • Registered Lounger
  • Group: Member
  • Posts: 4
  • Joined: 2005-03-20
  • Location:Durango, Colorado, USA

Wow, thanks this looks good and will be helpful. Thanks

#11 User is offline fburg

  • Bronze Lounger (over 1200 posts)
  • Group: Member
  • Posts: 1569
  • Joined: 2001-01-11
  • Location:West Long Branch, New Jersey, USA

Hi macropod,

I'm confused. It appears in looking at the current version of your post that you were posting V1.02. I checked my archives and found there was a V1.02 last spring (April or so). The description of what's covered seems to be the same. The file size is the same. Is this a posting of a new V1.03 or V1.02+?

I know you can edit your old post and change the text and the attachment. Even tho it's a convenience for you, I find it confusing for my old feeble mind grin to keep up what's new or not.

But new or not, it's certainly a great piece of work.

Thanks.

Fred

#12 User is offline Slinky

  • Slinky
  • Group: Member
  • Posts: 85697
  • Joined: 2002-03-22

Sorry about the confusion. Macropod is innocent. This weekend, we found out that macropod's post had never been awarded the star it deserved, although it was almost a year old. It was starred, and to get it listed in the StarPost banner, its date was updated (the StarPost banner always lists the most recent star post.) The contents of the post and its attachment are unchanged.

#13 User is offline fburg

  • Bronze Lounger (over 1200 posts)
  • Group: Member
  • Posts: 1569
  • Joined: 2001-01-11
  • Location:West Long Branch, New Jersey, USA

And a well deserved star at that, even if it's a little late.

Fred

#14 User is offline Rudi

  • LoungeOwl
  • Group: Member
  • Posts: 4595
  • Joined: 2004-02-25
  • Location:Cape Town, RSA

I've just read the post now, and also want to compliment you on some awesome info. This is definetly a post i will visit from time to time to collect some useful calculation strategies.

Cheers

#15 User is offline csimms

  • 4-Star Lounger (over 400 posts)
  • Group: Member
  • Posts: 432
  • Joined: 2004-09-21
  • Location:Sacramento, California, USA

Wow, absolutly great for reference. Something I will keep and use many times in future. Thank you for an outstanding post.

Carla

#16 User is offline AlanMiller

  • Platinum Lounger (over 3500 posts)
  • Group: VIP
  • Posts: 5772
  • Joined: 2001-11-06
  • Location:Melbourne, Victoria, Australia

Can't wait to dig into the latest book of spells and hexes! grin I'm just wondering if it would be possible/ easy to highlight new features in the contents description, as each new and exciting installment comes to our screens? Either way, many thanks for your continuing unique insights.

Alan

#17 User is offline macropod

  • Silver Lounger (over 1600 posts)
  • Group: Moderator
  • Posts: 2317
  • Joined: 2002-05-11
  • Location:Canberra, Australian Capital Territory, Australia

Hi Alan,

The latest update was just a bug fix - one of the fields dealing with output formatting was returning an error message.

Cheers

#18 User is offline kweaver

  • 4-Star Lounger (over 400 posts)
  • Group: Member
  • Posts: 505
  • Joined: 2001-01-03
  • Location:La Jolla,CA

I looked at the section on superscripting ordinals and guess I'm being really dumb about this, because I can't get the superscripting to work in the field code. It works nicely in Word using CRTL+SHIFT++, but {=5 # th} didn't do it for me. I entered the th using CTRL+SHIFT++ in another attempt and it didn't work either. What obvious thing am I missing here?

#19 User is offline macropod

  • Silver Lounger (over 1600 posts)
  • Group: Moderator
  • Posts: 2317
  • Joined: 2002-05-11
  • Location:Canberra, Australian Capital Territory, Australia

Hi kweaver,

If you select either or boith of the examples in the document and press Shift-F9, that will expose the field code, which is quite different to what you have.

#20 User is offline kweaver

  • 4-Star Lounger (over 400 posts)
  • Group: Member
  • Posts: 505
  • Joined: 2001-01-03
  • Location:La Jolla,CA

I did look at the code but was trying to create a very simplified example without all of the conditionals and couldn't replicate it.
I just wanted to do 5th (superscript th) and thought 5{=1 # th} was following what you did...but, it obviously wasn't nor do I see why not. I don't know how you got the superscripted th in the field braces or why the above didn't work just for a simple case. Even when I used CTRL+SHIFT++ for the th, etc., the first one (the th) lost the "t" in the output from the field.

Thanks.


1 reading this thread
0 members, 1 guests, 0 anonymous