View Single Post
 
Old 02-06-2024, 12:39 PM
PammieJean PammieJean is offline Windows 10 Office 2021
Novice
 
Join Date: Feb 2024
Location: Illinois
Posts: 1
PammieJean is on a distinguished road
Question How to apply number formatting to Merge Field in an IF function in Word

I’m having problems with a mail merge field number formatting in a table. The function below checks PR1 and PR2 (product) and if they are the same does nothing as there are no more records for that customer. If they are different it puts the amount from the excel data but the formatting is a problem.

There is a next if that sets PR1 before and checks the test column and sets PR2 after the next if. The Test is 1 if it’s the first record of a group and 0 if not (Test =IF(B2=B3,1,0) where B is customer number). The first row of the table uses the merge fields without an If statement and is correctly formatting the numbers for \#$0.00 but the subsequent rows are using the logic below to check if the product has changed, so it does not display duplicate rows, are not accepting number formatting no matter where I put the \#$0.00. What can I do to get correct number formatting?

Current Setup of the cell (without any number format since it wasn't working)

{ IF{ PR1 }={ PR2 } "" "{ MERGEFIELD M_2024_Price_per_lb__Whse }"}

Mail Merge Results: 2.1499999999999999

Excel File Data:

Accounting Format
2.15

Number Format 10 decimals
2.1500000000
Reply With Quote