Extracting Dates and Amounts from Raw Export

copyboy007

Board Regular
Joined
May 17, 2005
Messages
64
Office Version
  1. 2016
Platform
  1. Windows
Am trying to extract data from an exported paste of raw data in Column B (column A was only added for reference) of invoices (some include payments to subcontractors plus a subtotal), which merged and split some items (e.g., invoice numbers split into two rows; amounts were merged with text and dates). The formulas I've researched are in a grey shade when I was brainstorming how to group the invoice items and extract whatever I can. It also exported the page headers between page breaks, which is throwing off some formula results. The last two columns on the right that are not shaded, which contain sample data of what I'm trying to extract for each line. But, this still needs tweaks (or overhauling). Can this generic export become a proper data source to generate a pivot table that sees how every item is connected to every invoice.



Generic Sample2.xlsx
ABCDEFGHIJKLMNOP
1RowExported Raw DataabcdabcdAll InvoicesInvoice w/ SubInvoice w/o SubAll DatesAll DatesSub AmountSubInv. TotalInv. Date
221 YZ987654320022YZ98765432AYZ98765432A     75500.002/25/13
332A03003YZ98765432AYZ98765432A     75500.002/25/13
44Company A, Inc.(CCE) $21,897.1500404YZ98765432AYZ98765432A   21897.15Company A, Inc.(CCE)75500.002/25/13
55Better Company, Inc.(CCE) $2,186.7000505YZ98765432AYZ98765432A   2186.7Better Company, Inc.(CCE)75500.002/25/13
66Worse(CCE) $26,107.5800606YZ98765432AYZ98765432A   26107.58Worse(CCE)75500.002/25/13
77Laundry Svc. Inc.(EEE) $1,000.0000707YZ98765432AYZ98765432A   1000Laundry Svc. Inc.(EEE)75500.002/25/13
88Clothing, Inc.(FFE) $8,790.0000808YZ98765432AYZ98765432A   8790Clothing, Inc.(FFE)75500.002/25/13
99Total subconsultant Cost for Invoice 1: $59,981.4300909YZ98765432AYZ98765432A     75500.002/25/13
10102/25/13 $75,500.000001010YZ98765432AYZ98765432A  Date  75500.002/25/13
11112 AB21098760000 AB21098768 AB21098768xxx   
121280000 AB21098768 AB21098768    
13132/25/13 $2,977.500000 AB21098768 AB21098768 Date  
1414Page 1 of 40000 1 of 4Xyz Service Paperwork System 1 of 4Xyz Service Paperwork Systemxxx   
1515Xyz Service Paperwork System0000 1 of 4Xyz Service Paperwork System 1 of 4Xyz Service Paperwork System    
1616DETAILED STUFF INVOICE REPORT0000 1 of 4Xyz Service Paperwork System 1 of 4Xyz Service Paperwork System    
1717Printed: 4/30/20200000 1 of 4Xyz Service Paperwork System 1 of 4Xyz Service Paperwork System Date  
1818(Contract Title)0000 Title)Amazing Humble Services Title)Amazing Humble Servicesxxx   
1919Amazing Humble Services0000 Title)Amazing Humble Services Title)Amazing Humble Services    
2020Prime Consultant: Amazing Humble Services Contract Number: A1234560000 Title)Amazing Humble Services Title)Amazing Humble Services    
2121Task:01 Thingamajig Special Materials0000 Title)Amazing Humble Services Title)Amazing Humble Services    
2222Inv0000 Title)Amazing Humble Services Title)Amazing Humble Services    
2323No.0000 Title)Amazing Humble Services Title)Amazing Humble Services    
2424Vendor0000 Title)Amazing Humble Services Title)Amazing Humble Services    
2525Inv No.0000 Title)Amazing Humble Services Title)Amazing Humble Services    
2626Invoice0000 Title)Amazing Humble Services Title)Amazing Humble Services    
2727subconsultant0000 Title)Amazing Humble Services Title)Amazing Humble Services    
2828Invoice0000 Title)Amazing Humble Services Title)Amazing Humble Services    
2929Date0000 Title)Amazing Humble Services Title)Amazing Humble Services    
303010 102113300003010211331021133     
31313031003110211331021133     
3232Company A, Inc.(CCE) $7,551.14003203210211331021133   7551.14Company A, Inc.(CCE)
3333Better Company, Inc.(CCE) $3,658.89003303310211331021133   3658.89Better Company, Inc.(CCE)
3434Worse(CCE) $713.40003403410211331021133   713.4Worse(CCE)
3535Z&A Industrial Stuff(OOE) $190.00003503510211331021133   190Z&A Industrial Stuff(OOE)
3636Laundry Svc. Inc.(EEE) $575.00003603610211331021133   575Laundry Svc. Inc.(EEE)
3737Clothing, Inc.(FFE) $1,465.00003703710211331021133   1465Clothing, Inc.(FFE)
3838Total subconsultant Cost for Invoice 10: $14,153.43003803810211331021133     
393910/31/15 $19,520.25000393910211331021133  Date  
40404 GH4567894000040GH4567894GH4567894GH4567894xxx   
414140410041GH4567894GH4567894     
4242Company A, Inc.(CCE) $7,377.120042042GH4567894GH4567894   7377.12Company A, Inc.(CCE)
4343Better Company, Inc.(CCE) $3,722.720043043GH4567894GH4567894   3722.72Better Company, Inc.(CCE)
4444Worse(CCE) $2,085.280044044GH4567894GH4567894   2085.28Worse(CCE)
4545Z&A Industrial Stuff(OOE) $190.000045045GH4567894GH4567894   190Z&A Industrial Stuff(OOE)
4646Laundry Svc. Inc.(EEE) $1,075.000046046GH4567894GH4567894   1075Laundry Svc. Inc.(EEE)
4747Clothing, Inc.(FFE) $1,465.000047047GH4567894GH4567894   1465Clothing, Inc.(FFE)
4848Total subconsultant Cost for Invoice 11: $15,915.120048048GH4567894GH4567894     
494910/30/16 $18,181.180004949GH4567894GH4567894  Date  
Sheet1 (2)
Cell Formulas
RangeFormula
C2:C49C2=IF(AND(D2=0,D3<>0),A2,0)
D2:D49D2=IF(AND(E2=0,E3<>0),A2,0)
E2:E49E2=IF(OR(ISNUMBER(SEARCH({") $","total subconsultant cost"},B2))),A2,0)
F2:F49F2=IF(AND(E2=0,E1<>0),A2,0)
G2:G49G2=IFERROR(LOOKUP(2,1/(C2:F2>0),C2:F2),"")
H2:H49H2=IF(OR(K2="xxx",C2<>0),MID($B2,FIND(" ",$B2)+1,99)&$B3,H1)
I2:I49I2=IF(C2<>0,MID($B2,FIND(" ",$B2)+1,99)&$B3,IF(G2="","",I1))
J2:J49J2=IF(K2="xxx",MID($B2,FIND(" ",$B2)+1,99)&$B3,IF(G2="",J1,""))
K2:K49K2=IF(COUNTIF(B1,"*/*/*"),"xxx","")
L2:L49L2=IF(LEN(B2)-LEN(SUBSTITUTE(B2,"/",""))>1,"Date","")
M2:M49M2=IF(ISNUMBER(SEARCH(") $",B2)),MID($B2,FIND(" $",$B2)+1,99)+0,"")
N2:N49N2=IF(ISNUMBER(SEARCH(") $",B2)),LEFT(B2,(FIND(") $",B2)-0)),"")
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
So, any ideas about formulas for columns O and P to get those manually entered results?
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top