Spreadsheet: 728785d1618641525-formula-to-create-a-report-of-differences-between-ins-and-outs-diff
Sheet: Sheet1

 | In | Material 1 | Material 2 | Material 3 | Material 4 | Material 5 | Material 6 | Material 7 | Material 8 | Material 9 | Material 10 | Total |  | Out | Material 1 | Material 2 | Material 3 | Material 4 | Material 5 | Material 6 | Material 7 | Material 8 | Material 9 | Material 10 | Total |  | Diff | Material 1 | Material 2 | Material 3 | Material 4 | Material 5 | Material 6 | Material 7 | Material 8 | Material 9 | Material 10 | Total
 | 2021-04-01 00:00:00 | 385.7 | 69.7 | 0 | 0 | 0 | 50.6 |  |  | 0 | 0 | 506 |  | 2021-04-01 00:00:00 | 385.7 | 69.7 | 0 | 0 | 0 | 50.6 | 0 | 0 | 0 | 0 | 506 |  | 2021-04-01 00:00:00
 | 2021-04-02 00:00:00 | 699.44 | 155.15 | 0 | 0 | 0 | 101.41 |  |  | 0 | 0 | 945.9999999999999 |  | 2021-04-02 00:00:00 | 389.44 | 155.15 | 0 | 0 | 0 | 101.41 | 0 | 300 | 0 | 0 | 946 |  | 2021-04-02 00:00:00
 | 2021-04-03 00:00:00 | 703.0999999999999 | 154.6 | 0 | 3 | 0 | 95.3 |  |  | 0 | 0 | 955.9999999999999 |  | 2021-04-03 00:00:00 | 204 | 154.6 | 0 | 3 | 0 | 95.3 | 0 | 499.1 | 0 | 0 | 956 |  | 2021-04-03 00:00:00
 | 2021-04-04 00:00:00 | 597.4 | 124.4 | 0 | 0 | 0 | 80.2 |  |  | 0 | 0 | 802 |  | 2021-04-04 00:00:00 | 497.4 | 124.4 | 0 | 0 | 0 | 80.2 | 0 | 100 | 0 | 0 | 802 |  | 2021-04-04 00:00:00
 | 2021-04-05 00:00:00 | 612.5999999999999 | 130.8 | 0 | 0 | 0 | 90.60000000000001 |  |  | 0 | 0 | 833.9999999999999 |  | 2021-04-05 00:00:00 | 612.6 | 130.8 | 0 | 0 | 0 | 90.6 | 0 | 0 | 0 | 0 | 834.0000000000001 |  | 2021-04-05 00:00:00
 | 2021-04-06 00:00:00 | 706.5999999999999 | 155.6 | 0 | 0 | 0 | 95.8 |  |  | 0 | 0 | 957.9999999999999 |  | 2021-04-06 00:00:00 | 284 | 155.6 | 0 | 0 | 0 | 95.8 | 0 | 422.6 | 0 | 0 | 958 |  | 2021-04-06 00:00:00
 | 2021-04-07 00:00:00 | 605.55 | 136.95 | 0 | 0 | 0 | 82.5 |  |  | 0 | 0 | 825 |  | 2021-04-07 00:00:00 | 415.55 | 136.95 | 0 | 0 | 0 | 82.5 | 0 | 190 | 0 | 0 | 825 |  | 2021-04-07 00:00:00
 | 2021-04-08 00:00:00 | 299.95 | 471.35 | 0 | 0 | 0 | 85.7 |  |  | 0 | 0 | 857 |  | 2021-04-08 00:00:00 | 299.95 | 471.35 | 0 | 0 | 0 | 85.7 | 0 | 0 | 0 | 0 | 857 |  | 2021-04-08 00:00:00
 | 2021-04-09 00:00:00 | 626.15 | 137.05 | 0 | 0 | 0 | 84.80000000000001 |  |  | 0 | 0 | 848 |  | 2021-04-09 00:00:00 | 474.15 | 137.05 | 0 | 0 | 0 | 84.8 | 0 | 152 | 0 | 0 | 848 |  | 2021-04-09 00:00:00
 | 2021-04-10 00:00:00 | 649.34 | 139.6 | 0 | 0 | 0 | 80.06 |  |  | 0 | 0 | 869 |  | 2021-04-10 00:00:00 | 193.8 | 139.6 | 0 | 0 | 0 | 86.89999999999999 | 0 | 448.7 | 0 | 0 | 869 |  | 2021-04-10 00:00:00
 | 2021-04-11 00:00:00 | 673 | 146 | 0 | 0 | 0 | 91 |  |  | 0 | 0 | 910 |  | 2021-04-11 00:00:00 | 673 | 146 | 0 | 0 | 0 | 91 | 0 | 0 | 0 | 0 | 910 |  | 2021-04-11 00:00:00
 | 2021-04-12 00:00:00 | 611.05 | 129.65 | 0 | 0 | 0 | 82.3 |  |  | 0 | 0 | 822.9999999999999 |  | 2021-04-12 00:00:00 | 198.05 | 129.65 | 0 | 0 | 0 | 82.3 | 0 | 413 | 0 | 0 | 823 |  | 2021-04-12 00:00:00
 | 2021-04-13 00:00:00 | 679.95 | 148.95 | 0 | 0 | 50 | 92.10000000000001 |  |  | 0 | 0 | 921.0000000000001 |  | 2021-04-13 00:00:00 | 199.75 | 148.95 | 0 | 0 | 0 | 92.1 | 0 | 480.2 | 0 | 0 | 921 |  | 2021-04-13 00:00:00
 | 2021-04-14 00:00:00 | 700 | 147.25 | 0 | 0 | 0 | 91.1 |  |  | 0 | 0 | 911 |  | 2021-04-14 00:00:00 | 672.6500000000001 | 147.25 | 0 | 0 | 0 | 91.1 | 0 | 0 | 0 | 0 | 911.0000000000001 |  | 2021-04-14 00:00:00
 | 2021-04-15 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-15 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-15 00:00:00
 | 2021-04-16 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-16 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-16 00:00:00
 | 2021-04-17 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-17 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-17 00:00:00
 | 2021-04-18 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-18 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-18 00:00:00
 | 2021-04-19 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-19 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-19 00:00:00
 | 2021-04-20 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-20 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-20 00:00:00
 | 2021-04-21 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-21 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-21 00:00:00
 | 2021-04-22 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-22 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-22 00:00:00
 | 2021-04-23 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-23 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-23 00:00:00
 | 2021-04-24 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-24 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-24 00:00:00
 | 2021-04-25 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-25 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-25 00:00:00
 | 2021-04-26 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-26 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-26 00:00:00
 | 2021-04-27 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-27 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-27 00:00:00
 | 2021-04-28 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-28 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-28 00:00:00
 | 2021-04-29 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-29 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-29 00:00:00
 | 2021-04-30 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 |  |  | 0 | 0 | 0 |  | 2021-04-30 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 2021-04-30 00:00:00
 |  |  |  |  |  |  |  |  |  |  |  | 0 |  | 00:00:00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 00:00:00
 | Total |  |  |  |  |  |  |  |  |  |  |  |  | Total |  |  |  |  |  |  |  |  |  |  |  |  | Total
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Could you help me in my question,please?
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | I have the following tables for quantities  of materials:  1-In 2-Out 3-Diff(In-Iut)
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | I need a formula to create a report of differences between INs and OUTs like the following report:
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | The report should be sorted by Material then Date
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Material | Date | In | Out | Diff
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Material 1 | 2021-04-02 00:00:00 | 699.44 | 389.44 |  |  |  | 2021-04-02 00:00:00 | 699.44 | 389.44 | 310
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Material 1 | 2021-04-14 00:00:00 | 700 | 672.6500000000001 |  |  | Material 1 | 2021-04-13 00:00:00 | 679.95 | 199.75 | 480.2
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Material 8 | 2021-04-02 00:00:00 | 0 | 300 |  |  | Material 1 | 2021-04-14 00:00:00 | 700 | 672.65 | 27.3499999999999
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Material 5 | 2021-04-13 00:00:00 | 50 | 0 |  |  | Material 5 | 2021-04-13 00:00:00 | 50 | 0 | 50
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Material 8 | 2021-04-02 00:00:00 | 0 | 300 | -300
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Material 8 | 2021-04-13 00:00:00 | 0 | 480.2 | -480.2