Share via

Reference Text in a Word Table Formula

Anonymous
2013-06-20T05:39:20+00:00

I have a table in a word document A1 to B5.

A1 to A5 is purely the label and the data is in B1 to B5.  The formula is inserted into B5.

I have text in B2.  One of two words - Either Refund or Payable.

I want to do a calculation on the other data depending on what word appears in B2.

If I was using Excel, my formula would be this:

=if(B2="Refund",B3-B4,"")

So For example I might have the word Refund in B2, $4000 in B3 and $150 in B4.  My answer should be $3850.  But in the same example if B2 was Payable then the answer would be nothing.

Why can't I get this to work?

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2013-06-20T07:40:36+00:00

    You will need bookmark the word in B2 and then use the following formula in B5 (assumes that your table is 2 rows by 5 columns as in Word the columns are A, B, C, etc

    { IF { REF B2 } = "Refund" { = B3 - B4 } }

    The above assumes that the bookmark name used is B2.

    You must use Ctrl+F9 to insert each pair of field delimiters { } and you use Alt+F9 to toggle off their display.

    You would need to be very careful that if the word in B2 is changed that the bookmark is not destroyed when it is changed

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2013-06-21T00:00:45+00:00

    Use

    { IF { REF B2 } = "Refund" { = B3 - B4 # "0.00" } }

    or

    { IF { REF B2 } = "Refund" { = B3 - B4 # "$,0.00" } }

    If you want the currency symbol and the thousands separator (you can delete either of them if only one of them is required)

    If cell B2 contains a Mergefield, instead of using the bookmark and Ref field, you could use:

    { IF { MERGEFIELD nameofmergefieldinB2 } = "Refund" { = B3 - B4 # "0.00" } }

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-06-20T22:20:02+00:00

    Ok,

    Does it matter if the word Refund or Payable is brought in from a merge field?

    Hold on - got it to work - I bookmarked the mergefield itself.  Seems to work no worries but now I have another problem.

    I want to format the calculation so that it shows two decimal points?

    Was this answer helpful?

    0 comments No comments