I posted the following problem in the Excel section, and now wonder whether it can be solved in Word without the use of VBA...
Suppose I have a two-column table like the following, where all the text is in the first column and the numbers are in the second column:
Cat Tabby 5
Dog Jack Russell 8
Cat Burmese 9
Ferret Noble British 11
Dog Miniature Schnauzer 22
Cat Siamese 6
<a blank row>
Dog Miniature Poodle 7
Crocodile Sharp-toothed 43
Badger Black-and-white 321
I want to calculate the total number of cats
and the total number of dogs
by testing the first three characters of A1, A2, A3...
and ignoring all blank, and non-cat/non-dog rows.
Somehow I don't think this can be done without VBA, but it would be nice for an expert to confirm this!
Thanks!
Is this a problem which can be solved?
-
- PlatinumLounger
- Posts: 5408
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Is this a problem which can be solved?
John Gray
"(or one of the team)" - how your appointment letter indicates you won't be seeing the Consultant...
"(or one of the team)" - how your appointment letter indicates you won't be seeing the Consultant...
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Is this a problem which can be solved?
Although Word has various calculative fields (incl. IF), it does not have LEFT() or SUMIF or Array capability.
Also, AFAIK, Word can ONLY calculate with numbers.
So, even if you did extract Cat and Dog into (for argument sake), the C column, you cannot use =IF(C1="Cat",1,0) as one cannot use text in calculations.
Also, AFAIK, Word can ONLY calculate with numbers.
So, even if you did extract Cat and Dog into (for argument sake), the C column, you cannot use =IF(C1="Cat",1,0) as one cannot use text in calculations.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Administrator
- Posts: 78494
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Is this a problem which can be solved?
Let's see if macropod reads this thread - if it is possible at all, he will know how to do it.
Best wishes,
Hans
Hans
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Is this a problem which can be solved?
Here is a bit of reading (TX to Macropod) attached. (From this post in Windows Secrets)
It might be possible by using bookmarks in the conditional expression....
It might be possible by using bookmarks in the conditional expression....
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- PlutoniumLounger
- Posts: 15630
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: Is this a problem which can be solved?
(attached)John Gray wrote:Thanks!
You're welcome!
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle
-
- Administrator
- Posts: 78494
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Is this a problem which can be solved?
Very nice Chris...
John may find this very handy indeed.
John may find this very handy indeed.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- PlutoniumLounger
- Posts: 15630
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: Is this a problem which can be solved?
Well, at least I landed it in the correct conference!HansV wrote:
Since my Turing machine has gotten as far as comparing two character strings of any length by converting each character to ASCII as a string of binary characters, perhaps John would like to avail himself ...
There's nothing heavier than an empty water bottle