#1   Report Post  
Posted to microsoft.public.word.docmanagement
Glenn
 
Posts: n/a
Default Create Formula

I have a mail merge doc that could have 6 records with Balances in them.
What I have that works for the first 2 records; =IF(Bal20,Bal2,Bal1).
Basicaly I want the last record that has a value 0 to print. How do I get
this to look at all 6 records, or am I doing this the wrong way?
--
Thanks for the help,

Glenn
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
macropod
 
Posts: n/a
Default Create Formula

Hi Glenn,

If your business rules are such that all balances after the first 0 balance
are 0 also, you could use:
{={Bal1}*({Bal2}=0)+{Bal2}*({Bal3}=0)+{Bal3}*({Bal 4}=0)+{Bal4}*({Bal5}=0)+{B
al5}*({Bal6}=0)+{Bal6}}
or even:
{=Bal1*(Bal2=0)+Bal2*(Bal3=0)+Bal3*(Bal4=0)+Bal4*( Bal5=0)+Bal5*(Bal6=0)+Bal6
}
No IF tests are required for these.

Alternatively, if you could have 0 balances interspersed with non-0
balances, you could use:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4} {IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}
or, if the non-0 balances are always +ve:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4} {IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}

Cheers


"Glenn" wrote in message
...
I have a mail merge doc that could have 6 records with Balances in them.
What I have that works for the first 2 records; =IF(Bal20,Bal2,Bal1).
Basicaly I want the last record that has a value 0 to print. How do I

get
this to look at all 6 records, or am I doing this the wrong way?
--
Thanks for the help,

Glenn



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Glenn
 
Posts: n/a
Default Create Formula

When I insert 1 of those into the formula it does not return anything. After
I click ok on the formula window, it just closes like I did not even add
anything in.
I must be doing something wrong??--
Thanks for the help,

Glenn


"macropod" wrote:

Hi Glenn,

If your business rules are such that all balances after the first 0 balance
are 0 also, you could use:
{={Bal1}*({Bal2}=0)+{Bal2}*({Bal3}=0)+{Bal3}*({Bal 4}=0)+{Bal4}*({Bal5}=0)+{B
al5}*({Bal6}=0)+{Bal6}}
or even:
{=Bal1*(Bal2=0)+Bal2*(Bal3=0)+Bal3*(Bal4=0)+Bal4*( Bal5=0)+Bal5*(Bal6=0)+Bal6
}
No IF tests are required for these.

Alternatively, if you could have 0 balances interspersed with non-0
balances, you could use:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4} {IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}
or, if the non-0 balances are always +ve:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4} {IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}

Cheers


"Glenn" wrote in message
...
I have a mail merge doc that could have 6 records with Balances in them.
What I have that works for the first 2 records; =IF(Bal20,Bal2,Bal1).
Basicaly I want the last record that has a value 0 to print. How do I

get
this to look at all 6 records, or am I doing this the wrong way?
--
Thanks for the help,

Glenn




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill
 
Posts: n/a
Default Create Formula

You have to create each field (anything between braces) using Ctrl+F9.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Glenn" wrote in message
...
When I insert 1 of those into the formula it does not return anything.

After
I click ok on the formula window, it just closes like I did not even add
anything in.
I must be doing something wrong??--
Thanks for the help,

Glenn


"macropod" wrote:

Hi Glenn,

If your business rules are such that all balances after the first 0

balance
are 0 also, you could use:

{={Bal1}*({Bal2}=0)+{Bal2}*({Bal3}=0)+{Bal3}*({Bal 4}=0)+{Bal4}*({Bal5}=0)+{B
al5}*({Bal6}=0)+{Bal6}}
or even:

{=Bal1*(Bal2=0)+Bal2*(Bal3=0)+Bal3*(Bal4=0)+Bal4*( Bal5=0)+Bal5*(Bal6=0)+Bal6
}
No IF tests are required for these.

Alternatively, if you could have 0 balances interspersed with non-0
balances, you could use:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4}

{IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}
or, if the non-0 balances are always +ve:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4} {IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}

Cheers


"Glenn" wrote in message
...
I have a mail merge doc that could have 6 records with Balances in

them.
What I have that works for the first 2 records; =IF(Bal20,Bal2,Bal1).
Basicaly I want the last record that has a value 0 to print. How do

I
get
this to look at all 6 records, or am I doing this the wrong way?
--
Thanks for the help,

Glenn





  #5   Report Post  
Posted to microsoft.public.word.docmanagement
macropod
 
Posts: n/a
Default Create Formula

Hi Glen,

For whichever formula you're using, you need to create the field braces
(i.e. '{ }") in pairs via Ctrl-F9 - you can't just type them.

The second example is the simplest in this respect, since it uses only one
field to hold the whole equation.

With the last two examples, you'll see they're nested six levels deep. To
replicate them, I'd suggest working from the right-hand end, in which case
you'd start off by pressing Ctrl-F9 six times in succession, to create '{
{ { { { { } } } } } }', adding 'Bal1' to the central pair, then moving to
the left and inserting another field for 'Bal2' (i.e. '{ { { { {{Bal2}
{Bal1} } } } } }'), and so on.

Note too that, for the most part, it's important to maintain the spacing (or
lack thereof) I've indicated in the examples.

Cheers


"Glenn" wrote in message
...
When I insert 1 of those into the formula it does not return anything.

After
I click ok on the formula window, it just closes like I did not even add
anything in.
I must be doing something wrong??--
Thanks for the help,

Glenn


"macropod" wrote:

Hi Glenn,

If your business rules are such that all balances after the first 0

balance
are 0 also, you could use:

{={Bal1}*({Bal2}=0)+{Bal2}*({Bal3}=0)+{Bal3}*({Bal 4}=0)+{Bal4}*({Bal5}=0)+{B
al5}*({Bal6}=0)+{Bal6}}
or even:

{=Bal1*(Bal2=0)+Bal2*(Bal3=0)+Bal3*(Bal4=0)+Bal4*( Bal5=0)+Bal5*(Bal6=0)+Bal6
}
No IF tests are required for these.

Alternatively, if you could have 0 balances interspersed with non-0
balances, you could use:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4}

{IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}
or, if the non-0 balances are always +ve:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4} {IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}

Cheers


"Glenn" wrote in message
...
I have a mail merge doc that could have 6 records with Balances in

them.
What I have that works for the first 2 records; =IF(Bal20,Bal2,Bal1).
Basicaly I want the last record that has a value 0 to print. How do

I
get
this to look at all 6 records, or am I doing this the wrong way?
--
Thanks for the help,

Glenn








  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Glenn
 
Posts: n/a
Default Create Formula

After using cntrl-F9 that formula works. When I do alt-F9 I can see the
formula, when I toggle off I get Error! Bookmark not defined.
I found another post on this, so I'll see if I can fix it.

Thanks,
--
Thanks for the help,

Glenn


"macropod" wrote:

Hi Glen,

For whichever formula you're using, you need to create the field braces
(i.e. '{ }") in pairs via Ctrl-F9 - you can't just type them.

The second example is the simplest in this respect, since it uses only one
field to hold the whole equation.

With the last two examples, you'll see they're nested six levels deep. To
replicate them, I'd suggest working from the right-hand end, in which case
you'd start off by pressing Ctrl-F9 six times in succession, to create '{
{ { { { { } } } } } }', adding 'Bal1' to the central pair, then moving to
the left and inserting another field for 'Bal2' (i.e. '{ { { { {{Bal2}
{Bal1} } } } } }'), and so on.

Note too that, for the most part, it's important to maintain the spacing (or
lack thereof) I've indicated in the examples.

Cheers


"Glenn" wrote in message
...
When I insert 1 of those into the formula it does not return anything.

After
I click ok on the formula window, it just closes like I did not even add
anything in.
I must be doing something wrong??--
Thanks for the help,

Glenn


"macropod" wrote:

Hi Glenn,

If your business rules are such that all balances after the first 0

balance
are 0 also, you could use:

{={Bal1}*({Bal2}=0)+{Bal2}*({Bal3}=0)+{Bal3}*({Bal 4}=0)+{Bal4}*({Bal5}=0)+{B
al5}*({Bal6}=0)+{Bal6}}
or even:

{=Bal1*(Bal2=0)+Bal2*(Bal3=0)+Bal3*(Bal4=0)+Bal4*( Bal5=0)+Bal5*(Bal6=0)+Bal6
}
No IF tests are required for these.

Alternatively, if you could have 0 balances interspersed with non-0
balances, you could use:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4}

{IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}
or, if the non-0 balances are always +ve:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4} {IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}

Cheers


"Glenn" wrote in message
...
I have a mail merge doc that could have 6 records with Balances in

them.
What I have that works for the first 2 records; =IF(Bal20,Bal2,Bal1).
Basicaly I want the last record that has a value 0 to print. How do

I
get
this to look at all 6 records, or am I doing this the wrong way?
--
Thanks for the help,

Glenn






  #7   Report Post  
Posted to microsoft.public.word.docmanagement
macropod
 
Posts: n/a
Default Create Formula

Hi Glenn,

The 'Error! Bookmark not defined' message could mean you've mistyped one of
the variables. In fact, given that you originally mentioned using this in "a
mail merge doc", I suspect these are actually merged records. In that case,
each of the variables needs to be input as a mailmerge field - simply
inputting the mailmerge variable names won't do.

If you set up the mailmerge with the various fields (ie «Bal1» «Bal2» «Bal3»
«Bal4» «Bal5» «Bal6»), then you can copy & paste them into the formulae
like:
{=«Bal1»*(«Bal2»0)+«Bal2»*(«Bal3»=0)+«Bal3»*(«Bal4 »=0)+«Bal4»*(«Bal5»=0)+«Ba
l5»*(«Bal6»=0)+«Bal6»}
or
{IF«Bal6» 0 «Bal6» {IF«Bal5» 0 «Bal5» {IF«Bal4» 0 «Bal4» {IF«Bal3» 0
«Bal3» {IF«Bal2» 0 «Bal2» «Bal1»}}}}}
or
{IF«Bal6» 0 «Bal6» {IF«Bal5» 0 «Bal5» {IF«Bal4» 0 «Bal4» {IF«Bal3» 0
«Bal3» {IF«Bal2» 0 «Bal2» «Bal1»}}}}}

Cheers


"Glenn" wrote in message
...
After using cntrl-F9 that formula works. When I do alt-F9 I can see the
formula, when I toggle off I get Error! Bookmark not defined.
I found another post on this, so I'll see if I can fix it.

Thanks,
--
Thanks for the help,

Glenn


"macropod" wrote:

Hi Glen,

For whichever formula you're using, you need to create the field braces
(i.e. '{ }") in pairs via Ctrl-F9 - you can't just type them.

The second example is the simplest in this respect, since it uses only

one
field to hold the whole equation.

With the last two examples, you'll see they're nested six levels deep.

To
replicate them, I'd suggest working from the right-hand end, in which

case
you'd start off by pressing Ctrl-F9 six times in succession, to create

'{
{ { { { { } } } } } }', adding 'Bal1' to the central pair, then moving

to
the left and inserting another field for 'Bal2' (i.e. '{ { { { {{Bal2}
{Bal1} } } } } }'), and so on.

Note too that, for the most part, it's important to maintain the spacing

(or
lack thereof) I've indicated in the examples.

Cheers


"Glenn" wrote in message
...
When I insert 1 of those into the formula it does not return anything.

After
I click ok on the formula window, it just closes like I did not even

add
anything in.
I must be doing something wrong??--
Thanks for the help,

Glenn


"macropod" wrote:

Hi Glenn,

If your business rules are such that all balances after the first 0

balance
are 0 also, you could use:


{={Bal1}*({Bal2}=0)+{Bal2}*({Bal3}=0)+{Bal3}*({Bal 4}=0)+{Bal4}*({Bal5}=0)+{B
al5}*({Bal6}=0)+{Bal6}}
or even:


{=Bal1*(Bal2=0)+Bal2*(Bal3=0)+Bal3*(Bal4=0)+Bal4*( Bal5=0)+Bal5*(Bal6=0)+Bal6
}
No IF tests are required for these.

Alternatively, if you could have 0 balances interspersed with non-0
balances, you could use:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4}

{IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}
or, if the non-0 balances are always +ve:
{IF{Bal6} 0 {Bal6} {IF{Bal5} 0 {Bal5} {IF{Bal4} 0 {Bal4}

{IF{Bal3} 0
{Bal3} {IF{Bal2} 0 {Bal2} {Bal1}}}}}}

Cheers


"Glenn" wrote in message
...
I have a mail merge doc that could have 6 records with Balances in

them.
What I have that works for the first 2 records;

=IF(Bal20,Bal2,Bal1).
Basicaly I want the last record that has a value 0 to print.

How do
I
get
this to look at all 6 records, or am I doing this the wrong way?
--
Thanks for the help,

Glenn








Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create multiple documents from one and vice versa Village Idiot Dan Microsoft Word Help 7 October 24th 05 02:27 PM
Looking for shortcut for placing frequently used formula in table Susan M. Microsoft Word Help 1 September 9th 05 12:15 AM
Formula - page, numpages,...field Ludek Microsoft Word Help 1 September 5th 05 11:01 AM
Should be able to create a merged letter document and envelope do. ErieZoo Mailmerge 1 December 9th 04 12:43 AM
I need a formula of amount of hours from two times in two cell? dmvargas29 Tables 2 November 20th 04 02:48 AM


All times are GMT +1. The time now is 09:38 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"