Results 1 to 4 of 4
Thread: error with If formula in Word

20141027, 10:05 #1
 Join Date
 Oct 2014
 Posts
 2
 Thanks
 0
 Thanked 0 Times in 0 Posts
error with If formula in Word
Hello,
I need to use If Formula in Word but unfortunately it is not working.
I have used the follwing syntax
{=IF{B1}="" "Yes" "No"}
which means if b1 is blank return Yes otherwise NO. Could you please let me know what is wrong with my syntax
and my second part is that I want to count number of occurrences of Blank B cells. How can I do it?
thanks

20141027, 15:44 #2
 Join Date
 May 2002
 Location
 Canberra, Australian Capital Territory, Australia
 Posts
 5,216
 Thanks
 2
 Thanked 465 Times in 382 Posts
Word fields cannot test text with cell references; only numbers can be tested. To test text, the text would have to be bookmarked; then you can test the bookmark's content. Accordingly, the solution depends on what the content of B1 might be when it is not blank. If B1 can be blank or contain nonzero numbers, you could use:
{IF{=B1}= 0 "Yes" "No"}
(note the corrected syntax) or even:
{=B1 \# "'No';'No';'Yes'"}
As for counting blanks (again assuming your cells only contain blanks of nonzero numbers), you could use a formula like:
{=10COUNT(B2:B11) \# 0}
Note: The above formula work even if the cells have text in them, provided the only numbers are nonzero (e.g. 1, 10, etc. but not 0 on its own).
To see how to do a wide range of calculations in Word, check out my Microsoft Word Field Maths Tutorial. It's a 'Sticky' thread at the top of this forum:
https://windowssecrets.com/forums/sho...MathsTutorialCheers,
Paul Edstein
[MS MVP  Word]

20141028, 11:55 #3
 Join Date
 Oct 2014
 Posts
 2
 Thanks
 0
 Thanked 0 Times in 0 Posts
thanks for reply
I want to count number of occurrences in "Text" word in B column. how can I do it?
thanks

20141028, 15:51 #4
 Join Date
 May 2002
 Location
 Canberra, Australian Capital Territory, Australia
 Posts
 5,216
 Thanks
 2
 Thanked 465 Times in 382 Posts
You would need to bookmark each range in column B, not including the endofcell markers, and use a formula field like:
{={IF{Text1}= "Text" 1 0}+{IF{Text2}= "Text" 1 0}+{IF{Text3}= "Text" 1 0}+{IF{Text4}= "Text" 1 0}+{IF{Text5}= "Text" 1 0}+{IF{Text6}= "Text" 1 0}+{IF{Text7}= "Text" 1 0}+{IF{Text8}= "Text" 1 0}+{IF{Text9}= "Text" 1 0} \# 0 }
where Text1, Text2, etc. are your bookmark names.Cheers,
Paul Edstein
[MS MVP  Word]