Spreadsheet: 162487d1339931550-need-helpformulating-the-price-with-various-condition-and-counting-problem-xchoco-oeldere2-
Sheet: Sheet1

 |  | A | 8 | A | 3 |  | Please, don’t work with merged cells. |  |  |  |  | Table
 |  |  |  |  |  |  |  |  |  |  |  | 0 | -0.1
Demand CODE |  | A |  | 8 |  | A |  | 3 |  |  |  | 1 | 2
 |  |  |  |  |  |  |  |  |  |  |  | 2 | 4
 | 1st Code | Price | Total |  | 2nd Code | Price | Total |  |  |  |  | 3 | 6
 |  |  |  |  |  |  |  |  |  | the price at total column 1st problem is in : |  |  |  | for the 2nd problem the total column is :
 | 83 | 100000 | should be times(*) with 2 |  | 83 | 50000 | disc 10% |  |  | cell D6 the total is 200.000 |  |  |  | cell D23 the total is 45.000
 | C9 | 200000 | disc 10% |  | A8 | 100000 | disc 10% |  |  | cell [NAME] the total is 180.000 |  |  |  | cell [NAME] the total is 80.000
 | [NAME] | 50000 | disc 10% |  | E3 | 200000 | disc 10% |  |  | cell D8 the total is 45.000 |  |  |  | cell D25 the total is 180.000
 | A8 | 150000 | should be time(*) with 4 |  | A3 | 50000 | should be times with 5 |  |  | cell D9 the total is 600.000 |  |  |  | cell D26 the total is 250.000
 | B4 | 250000 | disc 10% |  | 8E | 150000 | disc 10% |  |  | cell D10 the total is 225.000 |  |  |  | cell D27 the total is 135.000
 | G5 | 100000 | disc 10% |  | AE | 250000 | disc 10% |  |  | cell D11 the total is 80.000 |  |  |  | cell D28 the total is 225.000
 | K7 | 50000 | disc 10% |  |  |  |  |  |  | cell D12 the total is 45.000
 |  |  | 1e value | 2e value | total
 | 83 |  | 1 | 1 | 1 | 100000 | 2 | 200000
 | C9 |  | 0 | 0 | 0 | 200000 | -0.1 | 180000
 | [NAME] |  | 0 | 1 | 1 | 50000 | 2 | 100000 | not the same anwer
 | A8 |  | 2 | 1 | 2 | 150000 | 4 | 600000
 | B4 |  | 0 | 0 | 0 | 250000 | -0.1 | 225000
 | G5 |  | 0 | 0 | 0 | 100000 | -0.1 | 90000 | not the same anwer
 | K7 |  | 0 | 0 | 0 | 50000 | -0.1 | 45000
my 1st problem is :
1. in the "Total Column (D6)" , I want the count is : if the "1st Code Column (B6)" first digit and second digit has 1 same code with the "CODE Column (C2,E2,G2 and I2)" then the "PRICE Column (C6)" should be times (*) with 2
2. in the "Total Column (D6)" , I want the count is : if the "1st Code Column (B6)" first digit has a 2 same code and second digit has 1 same code with the "CODE Column (C2,E2,G2 and I2)" then the "PRICE Column (C6)" should be times (*) with 4 {so with the opposite if first digit has 1 same code and second digit has 2 same code}
3. in the "Total Column (D6)" , I want the count is : if the "1st Code Column (B6)" first digit has a 3 same code and second digit has 1 same code with the "CODE Column (C2,E2,G2 and I2)" then the "PRICE Column (C6)" should be times (*) with 6 {so with the opposite if first digit has 1 same code and second digit has 3 same code}
4. in the "Total Column (D6)" , I want the count is : if the "1st Code Column (B6)" first digit has a 2 same code and second digit has 2 same code with the "CODE Column (C2,E2,G2 and I2)" then the "PRICE Column (B6)" should be times (*) with 6
5. if there is no same code or got only 1 same code in the first or second digit "1st Code Column (B6)" and "Code Column (C2,E2,G2 and I2) then the "Price Column (C6)" will get a 5% discount.
my 2nd problem is :
1.in the "Total Column (G6)" , I want the count is : if the "2nd Code Column (F6)" first digit has a same code with the "Code Column (G2) and the second digit has a same code with the "Code Column (I3)" then the price should be times (*) with 5
2.if there is no same code then the "Price Column (F6)" will get a 10% discount