Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count the number of occurrences in a Word 2000 Table

Status
Not open for further replies.

shaleen7

MIS
Jun 23, 2002
188
US
I have the user place the letter X in each word table cell.
I need to keep track of the number of x's the placed in each cell.

I tried to use the count function =count(a1:a14,"x")and =countif(a1:a14,"x") and =count(above,"x") but none worked.

What's wrong with my formula?
 
Just to clarify.

This is a Word table.

The user places an "x" in a cell. It sounds like they can put more than one "x" in a single cell.

keep track of the number of x's the placed in each cell

Is this correct? Or are they to put single "x" in one cell, with multiple rows - each of which can have an "x"?

To start, in a table, Word (unlike Excel) only calculates congruent values. As soon as it encounters a blank row (cell) the formula quits. As in:

16
- blank -
2
4
SUM(ABOVE) = 6

* * * * * *
16
3
2
4
SUM(ABOVE) = 25

Could you describe what you are trying to do? And in particular if there is going to be a single value in a cell, or multiple ones.

Gerry
 
There will be a single value in each cell.

COLUMN 1 COLUMN 2
X CAT
DOG
X BIRD

Thanks
 
Do your table in Excel and use the Formula:
Code:
COUNTA(A1:A14)
Then, in your Word document,
Insert > Object > Microsoft Excel Worksheet
Create from File
Browse
...

Would that work for you?
 
Word formuale cannot count text entries in tables (or anywhere else for that matter). To get a 'proper' count in a Word table you could use 1 = X and 0 <> X and, on the 'count' row, use the formula =SUM(ABOVE) in a Word field.

If you really need to use Xs, your table would have to be set up as a form, set to fire a macro to do the counting and put the count of Xs in the 'count' row.

For more information of Word Field Maths, see:

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top