Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-02-2024, 07:41 AM
FlightRisk FlightRisk is offline Invoice merge grouping items on same order number with NEXTIF skipping every other order Windows 11 Invoice merge grouping items on same order number with NEXTIF skipping every other order Office 2021
Novice
Invoice merge grouping items on same order number with NEXTIF skipping every other order
 
Join Date: Jan 2024
Posts: 2
FlightRisk is on a distinguished road
Default Invoice merge grouping items on same order number with NEXTIF skipping every other order

Hi. New here and out of my league. Watched many videos and tried Paul's excellent tutorials in the sticky and searched here. I've even looked at the many to one plugin and solutions that use "DATABASE", but perhaps I am close since it works other than skipping ever other new order number.

I have a CSV file that comes to me in a format like this:

Code:

Order ID  First Name  Last Name  Shipping Total  Order Total  Product Title
444453    Jack           Smith           6.2                  91.2           Motor Board
444453					                                             Motor Board
444453					                                             WiFi Board
444453                                                                                 Expander Board
444454   John            Doe           4.99                  44.89       Motor Board
444455   Bob             Bobbly     13.64	             95.44        Motor Board
444456   Shawn	    Payton      5.64                  83.44        Motor Board

The table in the Word Invoice would obviously group all the things by order ID and put them in the appropriate cells, total things, and then merge into their "individual documents". Order 1 (444453) merges and puts each record in the correct line item for it's document, but then it skips the next order number, does the next one correctly, skips the next one, and so on.

The "NEXTIF" sections in the table look like this (simplified without some totaling fields):

Code:
{ MERGEFIELD Model_Number}
{ MERGEFIELD Product_Title }
{SET ID1 "{MERGEFIELD Order_ID}"

The next row in the table has:

{ NEXTIF{ MERGEFIELD Order_ID } = { ID1 }}{SET ID2"{MERGEFIELD Order_ID}"}{IF ID1 = ID2 "{MERGEFIELD Quantity}" ""}
The above is pasted again and again in each row in the table to cover a maximum of 6 items per order. This is just the QTY field, but the description is next, then amount, etc.

I am thinking I need to reset ID1 or ID2 somewhere possibly? I have attached small, simplified demo versions of the CSV data file (as a text file since this forum won't accept CSV files) and the Word mailmerge template. I think it is just a "letter", not a "directory", but still trying to learn what the difference is and if it is important since I think it is working except for my logic flow. Thank you!
Attached Files
File Type: docx test_merge.docx (115.4 KB, 4 views)
File Type: txt orders_test.txt (1.8 KB, 4 views)

Last edited by FlightRisk; 01-02-2024 at 07:51 AM. Reason: trying to get table entries to line up
Reply With Quote
  #2  
Old 01-02-2024, 10:31 AM
gmayor's Avatar
gmayor gmayor is offline Invoice merge grouping items on same order number with NEXTIF skipping every other order Windows 10 Invoice merge grouping items on same order number with NEXTIF skipping every other order Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Save your data as Excel format and modify your document so that it has only one table and Merge Many To One will handle this merge.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 01-02-2024, 12:10 PM
FlightRisk FlightRisk is offline Invoice merge grouping items on same order number with NEXTIF skipping every other order Windows 11 Invoice merge grouping items on same order number with NEXTIF skipping every other order Office 2021
Novice
Invoice merge grouping items on same order number with NEXTIF skipping every other order
 
Join Date: Jan 2024
Posts: 2
FlightRisk is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
Save your data as Excel format and modify your document so that it has only one table and Merge Many To One will handle this merge.
I appreciate the help. I did mention ManyToOne. I really can't use that for this because I am trying to make things easier and eliminate steps. I was hoping since it is working except for skipping every other record, that there was just something simple I was missing. I am willing to pay someone to fix it.
Reply With Quote
Reply

Tags
invoice, merge, nextif



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I paste items in the order they were copied, not the order the are listed? manish500 Word 6 07-25-2018 12:07 AM
Invoice merge grouping items on same order number with NEXTIF skipping every other order count a number of cells based on the beginning of a order number Kubi Excel 2 08-06-2017 08:54 PM
Invoice merge grouping items on same order number with NEXTIF skipping every other order How do you place a list of items in alph order cinque8 Word 2 08-13-2016 02:23 PM
Invoice merge grouping items on same order number with NEXTIF skipping every other order How do I change the page number order? officeboy09 Excel 4 10-30-2013 08:11 PM
chronological order number needs to be changed as ndash sajeev Word 0 09-15-2010 07:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft