#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
See Mailmerge Number & Currency Formatting in the Mailmerge Tips & Tricks 'Sticky' thread at the top of this page: https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
if function, mail merge, number format |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Apply Image formatting to all pictures in the word using VBA | RobertDany | Word VBA | 2 | 10-29-2023 03:23 PM |
Merge field return last 4 digits of a number | macquhele | Mail Merge | 6 | 08-01-2020 11:04 PM |
Apply Picture formatting to all pictures in the word file | si14 | Drawing and Graphics | 13 | 07-28-2018 03:31 AM |
Use a numerical merge field to subtract that number of months | MichaelSpedding | Mail Merge | 8 | 11-11-2015 01:11 PM |
Merge Field Formatting | Welshie82 | Mail Merge | 4 | 10-08-2012 03:38 AM |