compare extraction right data for information invoices with wrong data for each range

abdo meghari

Well-known Member
Joined
Aug 3, 2021
Messages
612
Office Version
  1. 2019
Hi
I want compare data based on column B CODE between two sheets.
first the result should be from row2 in COMPARE sheet just copy data without formatting I will do that manually.
second in SH1 will match CODE with DATA sheet and will copy CODE,BRAND,INVOICE NO from SH1 sheet to column B,C,D in COMPARE sheet (sometimes will I have more than one CODE in SH1 so when copy the INVOICE NO then should repeat in column D for COMPARE sheet as I did it ) , also will brings PRICE,TOTAL (G,H) for each item from SH1 to columns F,H in COMPARE sheet
third brings INVOICE NO(D)(sometimes will I have more than one CODE in DATA so when copy the INVOICE NO then should repeat in column E for COMPARE sheet as I did it ), PRICE,TOTAL (J,K) from DATA sheet to column E,G,I in COMPARE sheet
finally in columns J,K will calculate as I put some formulas if show minus values then will highlight red color
note: when brings values based on CODE should put for adjacent cells between two sheets to show arranging
every time when bring data should clear in COMPARE sheet from row2
ABDO.xlsm
ABCDEFGH
1INVOICE NO
2A7179
3ITEMCODEBRANDTYPEORIGINQTYPRICETOTAL
41BSJ100Dayton 1200r24 DA53 THIDaytonTHILAND4.001,650.006,600.00
5TOTAL6,600.00
6DISCOUNT
7NET6,600.00
8
9INVOICE NO
10A7180
11ITEMCODEBRANDTYPEORIGINQTYPRICETOTAL
121BSJ100Dayton 1200r24 DA53 THIDayton THILAND4.001,650.006,600.00
132BSJ101BS 1200R20 G580 THIBRIDGESTO NETHILAND5.002,000.0010,000.00
14TOTAL16,600.00
15DISCOUNT
16NET16,600.00
17
18INVOICE NO
19A7185
20ITEMCODEBRANDTYPEORIGINQTYPRICETOTAL
211BSJ101BS 1200R20 G580 THI BRIDGESTO NETHILAND4.002,000.008,000.00
222BSJ102BS 1200R20 G580 JAPBRIDGESTO NEJAPAN5.001,900.009,500.00
23TOTAL17,500.00
24DISCOUNT
25NET17,500.00
26
27INVOICE NO
28A7188
29ITEMCODEBRANDTYPEORIGINQTYPRICETOTAL
301BSJ101BS 1200R20 G580 THIBRIDGESTO NETHILAND4.002,000.008,000.00
312BSJ103BS 1200R20 R187 JAPBRIDGESTO NEJAPAN2.002,110.004,220.00
323BSJ102BS 1200R20 G580 JAPBRIDGESTO NEJAPAN5.001,900.009,500.00
33TOTAL21,720.00
34DISCOUNT
35NET21,720.00
SH1
Cell Formulas
RangeFormula
H4,H30:H32,H21:H22,H12:H13H4=F4*G4
H5H5=SUM(H4:H4)
H7,H35,H25,H16H7=H5-H6
H14,H23H14=SUM(H12:H13)
H33H33=SUM(H30:H32)



ABDO.xlsm
CDEFGHIJK
1DATEINVOIC NOCUSTOMERBRANDTYPEORIGINQTYUNIT PRICETOTAL
231/05/2023PTR-10000CRSTDayton 1200r24DA53 THI4.001,660.006,640.00
331/05/2023PTR-10000CRST6,640.00
431/05/2023PTR-10001VFDGDayton 1200r24 DA53 THI4.001,640.006,560.00
531/05/2023PTR-10001VFDGBS 1200R20 G580THI5.002,000.0010,000.00
631/05/2023PTR-10001VFDG16,560.00
731/05/2023PTR-10002VFDGBS 1200R20 G580THI4.002,000.008,000.00
831/05/2023PTR-10002VFDGBS 1200R20 G580JAP5.001,900.009,500.00
931/05/2023PTR-10002VFDG17,500.00
1031/05/2023PTR-10003VFDGBS 1200R20G580THI4.001,980.007,920.00
1131/05/2023PTR-10003MNHTYBS 1200R20R187JAP2.002,110.004,220.00
1231/05/2023PTR-10003MNHTYBS 1200R20G580JAP5.001,910.009,550.00
1331/05/2023PTR-10003MNHTY21,690.00
DATA
Cell Formulas
RangeFormula
K4:K5K4=J4*I4



ABDO.xlsm
ABCDEFGHIJK
1ITEMCODEBRANDRIGHT INVOCE NOWRONG INVOCE NORIGHT PRICE WRONG PRICE RIGHT TOTALWRONG TOTALDIFFERENCE PRICEDIFFERENCE TOTAL
2
3
4
5
6
7
8
9
COMPARE




result what I want it
ABDO.xlsm
ABCDEFGHIJK
1ITEMCODEBRANDRIGHT INVOCE NOWRONG INVOCE NORIGHT PRICE WRONG PRICE RIGHT TOTALWRONG TOTALDIFFERENCE PRICEDIFFERENCE TOTAL
21BSJ100Dayton 1200r24 DA53 THIA7179PTR-100001,650.001,660.006,600.006,640.00-10.00-40.00
32BSJ100Dayton 1200r24 DA53 THIA7180PTR-100011,650.001,640.006,600.006,560.0010.0040.00
43BSJ101BS 1200R20 G580 THIA7180PTR-100012,000.002,000.0010,000.0010,000.000.000.00
54BSJ101BS 1200R20 G580 THIA7185PTR-100022,000.002,000.008,000.008,000.000.000.00
65BSJ102BS 1200R20 G580 JAPA7185PTR-100021,900.001,900.009,500.009,500.000.000.00
76BSJ101BS 1200R20 G580 THIA7188PTR-100032,000.001,980.008,000.007,920.0020.0080.00
87BSJ103BS 1200R20 R187 JAPA7188PTR-100032,110.002,110.004,220.004,220.000.000.00
98BSJ102BS 1200R20 G580 JAPA7188PTR-100031,900.001,910.009,500.009,550.00-10.00-50.00
COMPARE
Cell Formulas
RangeFormula
J2:J9J2=F2-G2
K2:K9K2=H2-I2
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
sorry experts !
I realized there are missed columns about second picture
should be
ABDO
ABCDEFGHIJK
1ITEMCODEDATEINVOIC NOCUSTOMERBRANDTYPEORIGINQTYUNIT PRICETOTAL
21BSJ10031/05/2023PTR-10000CRSTDayton 1200r24DA53 THI4.001,660.006,640.00
3TOTAL31/05/2023PTR-10000CRST6,640.00
41BSJ10031/05/2023PTR-10001VFDGDayton 1200r24 DA53 THI4.001,640.006,560.00
52BSJ10131/05/2023PTR-10001VFDGBS 1200R20 G580THI5.002,000.0010,000.00
6TOTAL31/05/2023PTR-10001VFDG16,560.00
71BSJ10131/05/2023PTR-10002VFDGBS 1200R20 G580THI4.002,000.008,000.00
82BSJ10231/05/2023PTR-10002VFDGBS 1200R20 G580JAP5.001,900.009,500.00
9TOTAL31/05/2023PTR-10002VFDG17,500.00
101BSJ10131/05/2023PTR-10003VFDGBS 1200R20G580THI4.001,980.007,920.00
112BSJ10331/05/2023PTR-10003MNHTYBS 1200R20R187JAP2.002,110.004,220.00
123BSJ10231/05/2023PTR-10003MNHTYBS 1200R20G580JAP5.001,910.009,550.00
13TOTAL31/05/2023PTR-10003MNHTY21,690.00
DATA
Cell Formulas
RangeFormula
K4:K5K4=J4*I4
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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