Hi guys,
My Excel workbook consists of 4 worksheets;
Sheet 1 has date, item, location/address and number of deliveries,
Sheet 2 has date, item, total cost of the item.
Ref sheet consists of lookup values
Can someone please help me with the macros for the 4th worksheet (Sheet 3)
I want to assign macros to a command button in sheet 3; which will extract values from sheet 1 and 2, consolidate the cells with duplicate values from sheet 1(date, item, loc/address), sumif (number of items delivered) and provide me Invoice value for those units based on sheet2 values.
Thank you
My Excel workbook consists of 4 worksheets;
Sheet 1 has date, item, location/address and number of deliveries,
Sheet 2 has date, item, total cost of the item.
Ref sheet consists of lookup values
Can someone please help me with the macros for the 4th worksheet (Sheet 3)
I want to assign macros to a command button in sheet 3; which will extract values from sheet 1 and 2, consolidate the cells with duplicate values from sheet 1(date, item, loc/address), sumif (number of items delivered) and provide me Invoice value for those units based on sheet2 values.
Thank you
Invoice.xlsx | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | |||
1 | Sheet 1 | Sheet 2 | Ref sheet | |||||||||||||||||
2 | Date | Item | Location | Street | Unit | No. of items delivered | Date | Item | xx | Total price | ||||||||||
3 | 1/01/2022 | AA | Loc1 | 17 | 25 | 34 | 1/01/2022 | AA | ww | 100 | AA | |||||||||
4 | 1/01/2022 | AA | Loc1 | 17 | 25 | 34 | 1/01/2022 | BB | xx | 101 | BB | |||||||||
5 | 1/01/2022 | AA | Loc1 | 17 | 25 | 34 | 1/01/2022 | CC | yy | 102 | CC | |||||||||
6 | 1/01/2022 | AA | Loc1 | 16 | 26 | 61 | 1/01/2022 | DD | zz | 50 | ||||||||||
7 | 1/01/2022 | AA | Loc1 | 16 | 26 | 61 | 2/01/2022 | AA | ww | 113 | ||||||||||
8 | 1/01/2022 | CC | Loc1 | 16 | 26 | 92 | 2/01/2022 | BB | xx | 114 | ||||||||||
9 | 1/01/2022 | CC | Loc1 | 16 | 26 | 37 | 2/01/2022 | CC | yy | 115 | ||||||||||
10 | 1/01/2022 | BB | Loc1 | 16 | 26 | 52 | 2/01/2022 | DD | zz | 50 | ||||||||||
11 | 1/01/2022 | BB | Loc1 | 16 | 26 | 86 | ||||||||||||||
12 | 1/01/2022 | BB | Loc1 | 16 | 26 | 95 | ||||||||||||||
13 | 2/01/2022 | BB | Loc1 | 16 | 26 | 61 | Sheet 3 | |||||||||||||
14 | 2/01/2022 | CC | Loc1 | 16 | 26 | 67 | ||||||||||||||
15 | 2/01/2022 | CC | Loc1 | 16 | 26 | 65 | Date | Item | Location | Street | Unit | Total no. of items delivered | Invoice per unit | |||||||
16 | 2/01/2022 | CC | Loc2 | 16 | 26 | 69 | 1/01/2022 | AA | Loc1 | 17 | 25 | 101 | 52.48 | |||||||
17 | 2/01/2022 | CC | Loc2 | 16 | 26 | 65 | 1/01/2022 | AA | Loc1 | 16 | 26 | 123 | 63.45 | |||||||
18 | 1/01/2022 | BB | Loc1 | 16 | 26 | 233 | 120.52 | |||||||||||||
19 | 1/01/2022 | CC | Loc1 | 16 | 26 | 129 | 66.55 | |||||||||||||
20 | 2/01/2022 | BB | Loc1 | 16 | 26 | 61 | 64.15 | |||||||||||||
21 | 2/01/2022 | CC | Loc1 | 16 | 26 | 132 | 137.71 | |||||||||||||
22 | 2/01/2022 | CC | Loc2 | 16 | 26 | 134 | 140.15 | |||||||||||||
23 | ||||||||||||||||||||
24 | ||||||||||||||||||||
25 | ||||||||||||||||||||
26 | ||||||||||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
O16:O22 | O16 | =SUMIFS($F$3:$F$24,$A$3:$A$24,$J16,$B$3:$B$24,$K16,$C$3:$C$24,$L16,$D$3:$D$24,$M16,$E$3:$E$24,$N16) |
P16:P22 | P16 | =(SUM(SUMIFS($M$3:$M$10,$J$3:$J$10,$J16,$K$3:$K$10,$Q$3:$Q$5)))*($O16/SUMIF($A$3:$A$17,$J16,$F$3:$F$17)) |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
K7:L10 | Cell Value | <0 | text | NO |
M7:M10 | Cell Value | <0 | text | NO |
K3:L6 | Cell Value | <0 | text | NO |
M3:M6 | Cell Value | <0 | text | NO |