Using IF THEN statements in = formula ??

C

cory

Hi

I have a table that i am trying to build some logic into the problem i run
into is this

___E20_______F20__________H20____
/ list price / base discount / Net price /
----------------------------------------------

in the net price cell i use the equasion =e20*(1-f20/100)
which works fine but IF i do not have a base discount THEN i do not want the
list price to move into the net price box becuase that number is used else
where and if no discount i do not want it used.

The best i can figure it needs to be something like
IF f20 <>0 THEN =e20*(1-f20/100) ELSE end
but that does not work. Dont even know if it is possible to do in the field
on the document or if i need to write something up in VB to do this. But if
i write it in VB how do i refer to the cells of a table?

Any help would be greatly appreciated.
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < cory > écrivait :
In this message, < cory > wrote:

|| Hi
||
|| I have a table that i am trying to build some logic into the problem i
run
|| into is this
||
|| ___E20_______F20__________H20____
|| / list price / base discount / Net price /
|| ----------------------------------------------
||
|| in the net price cell i use the equasion =e20*(1-f20/100)
|| which works fine but IF i do not have a base discount THEN i do not want
the
|| list price to move into the net price box becuase that number is used
else
|| where and if no discount i do not want it used.
||
|| The best i can figure it needs to be something like
|| IF f20 <>0 THEN =e20*(1-f20/100) ELSE end
|| but that does not work. Dont even know if it is possible to do in the
field
|| on the document or if i need to write something up in VB to do this. But
if
|| i write it in VB how do i refer to the cells of a table?
||

Try this:

(Use CTRL-F9 to insert the curly braces)

{IF F20 <> 0 "{=E20*(1-F20/100)}" " F20"}

The spaces are important in:
IF F20 <> 0 "

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
C

cory

Jean-Guy Marcil said:
Bonjour,

Dans son message, < cory > écrivait :
In this message, < cory > wrote:

|| Hi
||
|| I have a table that i am trying to build some logic into the problem i
run
|| into is this
||
|| ___E20_______F20__________H20____
|| / list price / base discount / Net price /
|| ----------------------------------------------
||
|| in the net price cell i use the equasion =e20*(1-f20/100)
|| which works fine but IF i do not have a base discount THEN i do not want
the
|| list price to move into the net price box becuase that number is used
else
|| where and if no discount i do not want it used.
||
|| The best i can figure it needs to be something like
|| IF f20 <>0 THEN =e20*(1-f20/100) ELSE end
|| but that does not work. Dont even know if it is possible to do in the
field
|| on the document or if i need to write something up in VB to do this. But
if
|| i write it in VB how do i refer to the cells of a table?
||

Try this:

(Use CTRL-F9 to insert the curly braces)

{IF F20 <> 0 "{=E20*(1-F20/100)}" " F20"}

The spaces are important in:
IF F20 <> 0 "

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org


That did not do the trick it still makes list = net with that even if there is no value in F20
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < cory > écrivait :
In this message, < cory > wrote:

|| "Jean-Guy Marcil" wrote:
||
||| Bonjour,
|||
||| Dans son message, < cory > écrivait :
||| In this message, < cory > wrote:
|||
||||| Hi
|||||
||||| I have a table that i am trying to build some logic into the problem i
||| run
||||| into is this
|||||
||||| ___E20_______F20__________H20____
||||| / list price / base discount / Net price /
||||| ----------------------------------------------
|||||
||||| in the net price cell i use the equasion =e20*(1-f20/100)
||||| which works fine but IF i do not have a base discount THEN i do not
want
||| the
||||| list price to move into the net price box becuase that number is used
||| else
||||| where and if no discount i do not want it used.
|||||
||||| The best i can figure it needs to be something like
||||| IF f20 <>0 THEN =e20*(1-f20/100) ELSE end
||||| but that does not work. Dont even know if it is possible to do in the
||| field
||||| on the document or if i need to write something up in VB to do this.
But
||| if
||||| i write it in VB how do i refer to the cells of a table?
|||||
|||
||| Try this:
|||
||| (Use CTRL-F9 to insert the curly braces)
|||
||| {IF F20 <> 0 "{=E20*(1-F20/100)}" " F20"}
|||
||| The spaces are important in:
||| IF F20 <> 0 "
|||
||| --
||| Salut!
||| _______________________________________
||| Jean-Guy Marcil - Word MVP
||| (e-mail address removed)
||| Word MVP site: http://www.word.mvps.org
|||
|||
||| That did not do the trick it still makes list = net with that even if
there is no value in F20

Sorry, I thought that if there was no discount, then the net price would be
equal to the list price, and would be repeated in the net columnh (which is
the normal way of doing things in such tables). OTOH, I do not have all the
details, so, in your case, because you do not want the net price to show up
if there is no applicable discount, change
"F20"
to
""
at the end of the formula.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
C

cory

Jean-Guy Marcil said:
Bonjour,

Dans son message, < cory > écrivait :
In this message, < cory > wrote:

|| "Jean-Guy Marcil" wrote:
||
||| Bonjour,
|||
||| Dans son message, < cory > écrivait :
||| In this message, < cory > wrote:
|||
||||| Hi
|||||
||||| I have a table that i am trying to build some logic into the problem i
||| run
||||| into is this
|||||
||||| ___E20_______F20__________H20____
||||| / list price / base discount / Net price /
||||| ----------------------------------------------
|||||
||||| in the net price cell i use the equasion =e20*(1-f20/100)
||||| which works fine but IF i do not have a base discount THEN i do not
want
||| the
||||| list price to move into the net price box becuase that number is used
||| else
||||| where and if no discount i do not want it used.
|||||
||||| The best i can figure it needs to be something like
||||| IF f20 <>0 THEN =e20*(1-f20/100) ELSE end
||||| but that does not work. Dont even know if it is possible to do in the
||| field
||||| on the document or if i need to write something up in VB to do this.
But
||| if
||||| i write it in VB how do i refer to the cells of a table?
|||||
|||
||| Try this:
|||
||| (Use CTRL-F9 to insert the curly braces)
|||
||| {IF F20 <> 0 "{=E20*(1-F20/100)}" " F20"}
|||
||| The spaces are important in:
||| IF F20 <> 0 "
|||
||| --
||| Salut!
||| _______________________________________
||| Jean-Guy Marcil - Word MVP
||| (e-mail address removed)
||| Word MVP site: http://www.word.mvps.org
|||
|||
||| That did not do the trick it still makes list = net with that even if
there is no value in F20

Sorry, I thought that if there was no discount, then the net price would be
equal to the list price, and would be repeated in the net columnh (which is
the normal way of doing things in such tables). OTOH, I do not have all the
details, so, in your case, because you do not want the net price to show up
if there is no applicable discount, change
"F20"
to
""
at the end of the formula.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org



Still not working properly. It is as if word does not understand what F20 refers to. Is it possible i can e-mail you this thing and you can take a look at it? That may be the best aproach at this moment.

Other suggestions still welcome as well.
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < cory > écrivait :
In this message, < cory > wrote:

|||
||| Still not working properly. It is as if word does not understand what
F20 refers to. Is it
||| possible i can e-mail you this thing and you can take a look at it?
That may be the best
||| aproach at this moment.
||

Try this then:

{IF {=F20} <> 0 "{=E20*(1-F20/100)}" ""}

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
C

cory

Jean-Guy Marcil said:
Bonjour,

Dans son message, < cory > écrivait :
In this message, < cory > wrote:

|||
||| Still not working properly. It is as if word does not understand what
F20 refers to. Is it
||| possible i can e-mail you this thing and you can take a look at it?
That may be the best
||| aproach at this moment.
||

Try this then:

{IF {=F20} <> 0 "{=E20*(1-F20/100)}" ""}

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org



Perfect. Thank you very much!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top