Reply
 
Thread Tools Display Modes
  #1   Report Post  
Bg
 
Posts: n/a
Default if () function in table

I would like to test the contents of one table cell, and if it is empty set
the current table function to one text value, else set the current table cell
to a different text value.

I have tried adding the formula to the table cell using Insert|Field, and
then clicking the Formula button and entering: =if(B5="","Value 1", "Value
2"), and get a syntax error.

Can someone please provide an example that would work? Specifically, how do
I specify an empty or space value in the if statement, and then how am I
messing up syntactically?

Thanks!
  #2   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

Hi ?B?Qmc=?=,

I would like to test the contents of one table cell, and if it is empty set
the current table function to one text value, else set the current table cell
to a different text value.

I have tried adding the formula to the table cell using Insert|Field, and
then clicking the Formula button and entering: =if(B5="","Value 1", "Value
2"), and get a syntax error.

Can someone please provide an example that would work? Specifically, how do
I specify an empty or space value in the if statement, and then how am I
messing up syntactically?

Firstly, you must use FIELDS in order to perform functions and calculations in
Word. So If() won't work, and you won't be able to work via the Formula button.

Secondly, you can't test for an "empty" cell, because a cell in Word is NEVER
empty. It always holds the end-of-cell marker (combination of a paragraph mark,
plus a range that contains a pointer to the cell formatting and structure
information in the document's binary structure). You can test for a value of 0,
however. If the cell contains nothing, it will return 0.

Start with inserting an IF field, using place holders where you need additional
fields. Alt+F9 to see the field codes in the document. Then you can use
Insert/Field again for any fields you need to nest within the IF field. This
could work, for example:

{ IF { = B5 } = 0 "True value" "False values" }

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

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
Why there is no Table of Authorties function in my Word 2003 Joey_lim Microsoft Word Help 1 January 20th 05 05:07 PM
Dragging table column resets Sedonakids Tables 0 January 12th 05 02:11 AM
Row height problem with table in table Stephanie T. Tables 0 November 23rd 04 04:35 PM
table caption numbering scottkinsey Tables 1 November 11th 04 12:47 PM
Repeating Table headings with "Continued" scottkinsey Tables 4 November 10th 04 07:04 PM


All times are GMT +1. The time now is 10:58 AM.

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"