A family of Microsoft word processing software products for creating web, email, and print documents.
If you send me a copy of the document, referencing this thread in the covering email message, I will investigate the issue.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a formatted, field-coded Word document that's generated by a database. It has a table with a set size (say it's 10 rows) that has a column that contains individual $ values, and another column that subtracts one from the other. Something like this:
| Starting balance | $83 | |
|---|---|---|
| Transaction 1 | $20 | $63 |
| Transaction 2 | $20 | $43 |
| Transaction 3 | $50 | ($7) |
So C2 has a simple formula, =C1-B2. and so on.
The problem is we don't know how many rows there are going to be... there could be one, there could be seven. If there are too few rows, I end up with something like this:
| Starting balance | $83 | |
|---|---|---|
| Transaction 1 | $20 | $63 |
| $63 | ||
| $63 |
I would like C3 to have an IF statement that says "If B2 is blank, do nothing, If B2 has a number then C2-B2." The closest I got was a statement that puts a $0 in C3, but I want it to be blank.
Is there an IF statement I can put in a Word table that uses a formula for one result, and returns a blank otherwise?
A family of Microsoft word processing software products for creating web, email, and print documents.
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.
Answer accepted by question author
If you send me a copy of the document, referencing this thread in the covering email message, I will investigate the issue.
Thank you so much for the reply. I am not able to get this or the other solution to work. A blank is always returned, regardless of if there's something in column B. It seems like it should work. It's not returning a syntax error.
This is the actual code I'm using:
{ IF{ = D4 - C5 } = { = D4 } "" { = D4 - C5 } }
[different sized table than my example, but same idea]
Even if there's something in C5, it returns a blank when I 'Update Field'. I changed it to a plain
{ = D4 - C5 }
just to check, and it returns the expected number.
Am I missing something?
You might consider using the Many to One facility on my Merge Tools Add-in tthat is contained in the MERGE TOOLS ADD-IN.zip file that you can download from:
Extract the files from the archive and read the:
“READ ME – Setting up and using the Merge Tools Add-in.pdf
to see how to install and use the various tools.
Using those tools, it is possible to perform the following types of merge that cannot be done with Mail Merge “out-of-the-box”:
The requirements for using the system are:
The field construction you need looks like this:
which updates to
This is much easier to do in Excel than in Word. In the table above, each field has to be copied from the one above and then manually adjusted to refer to the correct row numbers. In Excel, using the Fill Down command automatically adjusts each cell's formula. Then you can copy the whole thing from Excel and paste it into Word, where it will continue to operate as an Excel object.