Replace formula with zero when populate Right mark for two sheets

abdo meghari

Well-known Member
Joined
Aug 3, 2021
Messages
612
Office Version
  1. 2019
Hello

I need to populate right or wrong mark in column I and replace zero in column H for one of the two sheets based on matching colum C (ORDER NO) with cell C7 (ORDER NO) in IN sheet and column E (BRAND) with after C12 cell (BRAND)in IN sheet . then should populate right mark and the others should wrong mark and when pouplate right mark should show zero in column H when right mark is existed in column I for one of the two sheets.

data
sheets(ORDERS SALES,ORDERS PURCHASE, IN)
REP.xlsm
ABCDEFGH
1DATEIDORDER NOCLIENT REFERENCEBRANDQTYUNIT PRICETOTAL
211/01/2023BSJ100FS-1000ABBDBS 1200R20 G580 JAP20.002,000.0040,000.00
312/01/2023BSJ101FS-1000ABBDBS 1200R20 G580 THI20.002,200.0044,000.00
413/01/2023BSJ102FS-1001XCDFFBS 1200R20 R187 JAP25.001,990.0049,750.00
514/01/2023BSJ103FS-1001XCDFFBS 1200R24 G580 JAP26.002,600.0067,600.00
615/01/2023BSJ100FS-1001XCDFFBS 1200R20 G580 JAP20.002,000.0040,000.00
716/01/2023BSJ101FS-1001XCDFFBS 1200R20 G580 THI20.002,200.0044,000.00
817/01/2023BSJ106FS-1002AQWEBS 315/80R22.5 R184 THI40.001,660.0066,400.00
918/01/2023BSJ106FS-1003CVGFBS 315/80R22.5 R184 THI10.001,670.0016,700.00
1019/01/2023BSJ106FS-1004AS-00BS 315/80R22.5 R184 THI45.001,660.0074,700.00
1120/01/2023BSJ106FS-1005AS-01BS 315/80R22.5 R184 THI20.001,660.0033,200.00
1221/01/2023BSJ106FS-1006AS-02BS 315/80R22.5 R184 THI10.001,660.0016,600.00
1322/01/2023BSJ106FS-1007AS-03BS 315/80R22.5 R184 THI5.001,660.008,300.00
1423/01/2023BSJ106FS-1008AS-04BS 315/80R22.5 R184 THI20.001,660.0033,200.00
1524/01/2023BSJ106FS-1009AS-05BS 315/80R22.5 R184 THI15.001,660.0024,900.00
1625/01/2023BSJ106FS-1010AS-06BS 315/80R22.5 R184 THI15.001,660.0024,900.00
1726/01/2023BSJ106FS-1011AS-07BS 315/80R22.5 R184 THI15.001,660.0024,900.00
1827/01/2023BSJ106FS-1012AS-08BS 315/80R22.5 R184 THI40.001,660.0066,400.00
1928/01/2023BSJ106FS-1013AS-09BS 315/80R22.5 R184 THI40.001,660.0066,400.00
2029/01/2023BSJ106FS-1014AS-10BS 315/80R22.5 R184 THI40.001,660.0066,400.00
2130/01/2023BSJ107FS-1014AS-10BS 315/80R22.5 R184 JAP10.001,880.0018,800.00
2231/01/2023BSJ107FS-1015AS-11BS 315/80R22.5 R184 JAP10.001,881.0018,810.00
2301/02/2023BSJ100FS-1015AS-11BS 1200R20 G580 JAP10.001,890.0018,900.00
2402/02/2023BSJ103FS-1015AS-11BS 1200R24 G580 JAP20.002,600.0052,000.00
2503/02/2023BSJ107FS-1016AS-12BS 315/80R22.5 R184 JAP10.001,890.0018,900.00
2604/02/2023BSJ103FS-1016AS-12BS 1200R24 G580 JAP15.002,500.0037,500.00
2705/02/2023BSJ100FS-1016AS-12BS 1200R20 G580 JAP5.002,100.0010,500.00
2806/02/2023BSJ101FS-1016AS-12BS 1200R20 G580 THI3.002,050.006,150.00
ORDERS SALES
Cell Formulas
RangeFormula
H2:H28H2=F2*G2


REP.xlsm
CDEFGH
1ORDER NOCLIENT REFERENCEBRANDQTYUNIT PRICETOTAL
2BBS-00BGHHYBS 1200R20 G580 JAP500.001,500.00750,000.00
3BBS-00BGHHYBS 1200R20 G580 THI300.001,600.00480,000.00
4BBS-00BGHHYBS 1200R20 R187 JAP150.001,450.00217,500.00
5BBS-00BGHHYBS 1200R24 G580 JAP260.002,000.00520,000.00
6BBS-01ASDERTBS 1200R20 G580 JAP340.001,550.00527,000.00
7BBS-01ASDERTBS 1200R20 G580 THI800.001,440.001,152,000.00
8BBS-01ASDERTBS 315/80R22.5 R184 THI500.001,250.00625,000.00
9BBS-02AZSD-00BS 1200R20 G580 JAP300.001,600.00480,000.00
10BBS-03AZSD-01BS 1200R20 G580 THI250.001,700.00425,000.00
11BBS-04AZSD-02BS 1200R20 G580 JAP300.001,800.00540,000.00
12BBS-05AZSD-03BS 1200R20 G580 THI350.001,900.00665,000.00
13BBS-06AZSD-04BS 1200R20 G580 JAP400.001,800.00720,000.00
14BBS-07AZSD-05BS 1200R20 G580 THI450.002,100.00945,000.00
15BBS-08AZSD-06BS 1200R20 G580 JAP500.002,200.001,100,000.00
16BBS-09AZSD-07BS 1200R20 G580 THI550.002,300.001,265,000.00
17BBS-10AZSD-08BS 1200R20 G580 JAP600.001,440.00864,000.00
18BBS-11AZSD-09BS 1200R20 G580 THI650.002,500.001,625,000.00
19BBS-12AZSD-10BS 1200R20 G580 JAP700.002,600.001,820,000.00
20BBS-13AZSD-11BS 1200R20 G580 THI750.001,330.00997,500.00
21BBS-14AZSD-12BS 1200R20 G580 JAP800.002,800.002,240,000.00
22BBS-15AZSD-13BS 1200R20 G580 THI850.002,900.002,465,000.00
23BBS-16AZSD-14BS 1200R20 G580 JAP900.003,000.002,700,000.00
24BBS-17AZSD-15BS 1200R20 G580 THI950.001,670.001,586,500.00
25BBS-18AZSD-16BS 1200R20 G580 JAP1,000.003,200.003,200,000.00
26BBS-19AZSD-17BS 1200R20 G580 THI1,050.003,300.003,465,000.00
27BBS-20AZSD-18BS 1200R20 G580 JAP1,100.001,760.001,936,000.00
28BBS-21AZSD-19BS 1200R20 G580 THI1,150.003,500.004,025,000.00
ORDERS PURCHASE
Cell Formulas
RangeFormula
H2:H28H2=F2*G2



REP.xlsm
ABCDEF
1
2CLIENT REFERENCE
3BGHHY
4DATE
510/01/2024
6ORDER NO
7BBS-00
8INVOICE NO
9BBBS-1000
10
11
12ITEMIDBRANDQTYUNIT PRICETOTAL
131BSJ100BS 1200R20 G580 JAP500.001,500.00750,000.00
142BSJ101BS 1200R20 G580 THI300.001,600.00480,000.00
153BSJ102BS 1200R20 R187 JAP150.001,450.00217,500.00
164BSJ103BS 1200R24 G580 JAP260.002,000.00520,000.00
17
18
19
20TOTAL1,210.001,967,500.00
IN
Cell Formulas
RangeFormula
C5C5=TODAY()
F13:F16F13=D13*E13
D20D20=SUM(D13:D19)
F20F20=SUM(F13:F16)

when matching (ORDER NO) in cell C7 and BRAND in after C12 in IN sheet with (ORDER NO) in column C (ORDER NO) and column E (BRAND) in sheet ORDERS SALES or sheet ORDERS PURCHASE then the result in column H will be zero and I will mark right & wrong for one of the two sheets like this

REP.xlsm
ABCDEFGHI
1DATEIDORDER NOCLIENT REFERENCEBRANDQTYUNIT PRICETOTAL
220/01/2023BSJ100BBS-00BGHHYBS 1200R20 G580 JAP500.001,500.000.00P
321/01/2023BSJ101BBS-00BGHHYBS 1200R20 G580 THI300.001,600.000.00P
422/01/2023BSJ102BBS-00BGHHYBS 1200R20 R187 JAP150.001,450.000.00P
523/01/2023BSJ103BBS-00BGHHYBS 1200R24 G580 JAP260.002,000.000.00P
624/01/2023BSJ100BBS-01ASDERTBS 1200R20 G580 JAP340.001,550.00527,000.00O
725/01/2023BSJ101BBS-01ASDERTBS 1200R20 G580 THI800.001,440.001,152,000.00O
826/01/2023BSJ106BBS-01ASDERTBS 315/80R22.5 R184 THI500.001,250.00625,000.00O
927/01/2023BSJ100BBS-02AZSD-00BS 1200R20 G580 JAP300.001,600.00480,000.00O
1028/01/2023BSJ101BBS-03AZSD-01BS 1200R20 G580 THI250.001,700.00425,000.00O
1129/01/2023BSJ100BBS-04AZSD-02BS 1200R20 G580 JAP300.001,800.00540,000.00O
1230/01/2023BSJ101BBS-05AZSD-03BS 1200R20 G580 THI350.001,900.00665,000.00O
1331/01/2023BSJ100BBS-06AZSD-04BS 1200R20 G580 JAP400.001,800.00720,000.00O
1401/02/2023BSJ101BBS-07AZSD-05BS 1200R20 G580 THI450.002,100.00945,000.00O
1502/02/2023BSJ100BBS-08AZSD-06BS 1200R20 G580 JAP500.002,200.001,100,000.00O
1603/02/2023BSJ101BBS-09AZSD-07BS 1200R20 G580 THI550.002,300.001,265,000.00O
1704/02/2023BSJ100BBS-10AZSD-08BS 1200R20 G580 JAP600.001,440.00864,000.00O
1805/02/2023BSJ101BBS-11AZSD-09BS 1200R20 G580 THI650.002,500.001,625,000.00O
1906/02/2023BSJ100BBS-12AZSD-10BS 1200R20 G580 JAP700.002,600.001,820,000.00O
2007/02/2023BSJ101BBS-13AZSD-11BS 1200R20 G580 THI750.001,330.00997,500.00O
2108/02/2023BSJ100BBS-14AZSD-12BS 1200R20 G580 JAP800.002,800.002,240,000.00O
2209/02/2023BSJ101BBS-15AZSD-13BS 1200R20 G580 THI850.002,900.002,465,000.00O
2310/02/2023BSJ100BBS-16AZSD-14BS 1200R20 G580 JAP900.003,000.002,700,000.00O
2411/02/2023BSJ101BBS-17AZSD-15BS 1200R20 G580 THI950.001,670.001,586,500.00O
2512/02/2023BSJ100BBS-18AZSD-16BS 1200R20 G580 JAP1,000.003,200.003,200,000.00O
2613/02/2023BSJ101BBS-19AZSD-17BS 1200R20 G580 THI1,050.003,300.003,465,000.00O
2714/02/2023BSJ100BBS-20AZSD-18BS 1200R20 G580 JAP1,100.001,760.001,936,000.00O
2815/02/2023BSJ101BBS-21AZSD-19BS 1200R20 G580 THI1,150.003,500.004,025,000.00O
ORDERS PURCHASE
Cell Formulas
RangeFormula
H6:H28H6=F6*G6

see the attached picture becuase XL2bb tool doesn't show RIGHT,WRONG mark
1.PNG

I hope somebody help me .
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Try this:

1704903701045.png



Book1
ABCDEFGHIJ
1DATEIDORDER NOCLIENT REFERENCEBRANDQTYUNIT PRICETOTALFORMAT COLUMN AS Wingdnings 2Use these formulas in cells in column H and I:
22023-01-20BSJ100BBS-00BGHHYBS 1200R20 G580 JAP50015000P=IF(AND(IN!$C$7=C2,ISNUMBER(MATCH($E2,IN!$C$3:$C$300,0))),0,F2*G2)
32023-01-21BSJ101BBS-00BGHHYBS 1200R20 G580 THI30016000P=IF(AND(IN!$C$7=C2,ISNUMBER(MATCH($E2,IN!$C$3:$C$300,0))),"P","O")
42023-01-22BSJ102BBS-00BGHHYBS 1200R20 R187 JAP15014500P
52023-01-23BSJ103BBS-00BGHHYBS 1200R24 G580 JAP26020000P
62023-01-24BSJ100BBS-01ASDERTBS 1200R20 G580 JAP3401550527000O
72023-01-25BSJ101BBS-01ASDERTBS 1200R20 G580 THI80014401152000O
82023-01-26BSJ106BBS-01ASDERTBS 315/80R22.5 R184 THI5001250625000O
92023-01-27BSJ100BBS-02AZSD-00BS 1200R20 G580 JAP3001600480000O
102023-01-28BSJ101BBS-03AZSD-01BS 1200R20 G580 THI2501700425000O
OrdersPurchase
Cell Formulas
RangeFormula
H2:H10H2=IF(AND(IN!$C$7=C2,ISNUMBER(MATCH($E2,IN!$C$3:$C$300,0))),0,F2*G2)
I2:I10I2=IF(AND(IN!$C$7=C2,ISNUMBER(MATCH($E2,IN!$C$3:$C$300,0))),"P","O")
J2J2=FORMULATEXT(H2)
J3J3=FORMULATEXT(I2)
 
Upvote 0
Solution

Forum statistics

Threads
1,223,883
Messages
6,175,167
Members
452,615
Latest member
bogeys2birdies

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