Xlambda
Well-known Member
- Joined
- Mar 8, 2021
- Messages
- 860
- Office Version
- 365
- Platform
- Windows
ADVCF ADVanced Conditional Formatting , for arrays, calls T_AFA , T_AFM. My approach on CF.
Having already ADVFLT , ADVCF is extremely easy, Same arguments, same functionality, hardcoding any conditions we want, bolean logic (and,or), capable. If filter syntax is FILTER(a,include), ADVCF is the include argument. Check ADVFLT post for more details. Other function on minisheet ACOUNTIFS
Task 1. For the given table highlight the records btwn 2 dates with sales over 50 units, for regions either East or West or for brand Apple whatever region. Out of this results , highlight the sales that took place on weekends. The formula we need:
Having already ADVFLT , ADVCF is extremely easy, Same arguments, same functionality, hardcoding any conditions we want, bolean logic (and,or), capable. If filter syntax is FILTER(a,include), ADVCF is the include argument. Check ADVFLT post for more details. Other function on minisheet ACOUNTIFS
Task 1. For the given table highlight the records btwn 2 dates with sales over 50 units, for regions either East or West or for brand Apple whatever region. Out of this results , highlight the sales that took place on weekends. The formula we need:
Excel Formula:
=LAMBDA(a,clm,crm,cla,cra,
LET(tm,IF(SUM(clm)=0,1,T_AFM(a,clm,crm,1)),ta,IF(SUM(cla)=0,1,T_AFA(a,cla,cra,0)),
IF(tm*ta,1,0)
)
)
LAMBDA 10.0.xlsx | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | |||
1 | sample table | =ADVCF(S,{1,1,10},{">=1-08-20","<1-05-21",">=50"},{3,8,8},{"Apple","East","West"}) | |||||||||||||||||||||||||||
2 | Date | Prod | Brand | Type | Cost | Price/u | Shop | Region | Manager | uSold | TCost | Rev | NetRev | =O3#+ACOUNTIFS(TEXT(S[Date],"ddd"),{"Sat";"Sun"}) | |||||||||||||||
3 | 09-07-20 | Prod 3 | Samsung | phone | 230 | 240 | Shop C | East | John S | 84 | 19320 | 20160 | 840 | 0 | 0 | ||||||||||||||
4 | 14-07-20 | Prod 1 | Apple | tablet | 280 | 350 | Shop F | South | Steve J | 85 | 23800 | 29750 | 5950 | 0 | 0 | CF formulas | |||||||||||||
5 | 23-07-20 | Prod 6 | Samsung | tablet | 170 | 185 | Shop C | East | John S | 11 | 1870 | 2035 | 165 | 0 | 0 | AaBbCc | =$O3 | ||||||||||||
6 | 30-07-20 | Prod 8 | Apple | laptop | 420 | 510 | Shop D | West | Mike B | 77 | 32340 | 39270 | 6930 | 0 | 0 | AaBbCc | =$Q3=2 | ||||||||||||
7 | 03-08-20 | Prod 4 | Apple | phone | 350 | 370 | Shop D | West | Mike B | 68 | 23800 | 25160 | 1360 | 1 | 1 | ||||||||||||||
8 | 08-08-20 | Prod 2 | HP | laptop | 520 | 620 | Shop C | East | John S | 34 | 17680 | 21080 | 3400 | 0 | 1 | AaBbCc | when both condition meet | ||||||||||||
9 | 22-08-20 | Prod 8 | Apple | laptop | 420 | 510 | Shop E | North | Bill T | 41 | 17220 | 20910 | 3690 | 0 | 1 | ||||||||||||||
10 | 02-09-20 | Prod 7 | Samsung | laptop | 650 | 780 | Shop A | East | John S | 90 | 58500 | 70200 | 11700 | 1 | 1 | ||||||||||||||
11 | 13-09-20 | Prod 4 | Apple | phone | 350 | 370 | Shop E | North | Bill T | 86 | 30100 | 31820 | 1720 | 1 | 2 | other formulas on minisheet | |||||||||||||
12 | 15-09-20 | Prod 3 | Samsung | phone | 230 | 240 | Shop B | West | David M | 26 | 5980 | 6240 | 260 | 0 | 0 | ACOUNTIFS | |||||||||||||
13 | 21-10-20 | Prod 1 | Apple | tablet | 280 | 350 | Shop C | East | John S | 77 | 21560 | 26950 | 5390 | 1 | 1 | ||||||||||||||
14 | 28-10-20 | Prod 8 | Apple | laptop | 420 | 510 | Shop C | East | John S | 78 | 32760 | 39780 | 7020 | 1 | 1 | Obs: | |||||||||||||
15 | 29-10-20 | Prod 1 | Apple | tablet | 280 | 350 | Shop B | West | David M | 80 | 22400 | 28000 | 5600 | 1 | 1 | ACOUNIFS can handle array calculation in its arguments | |||||||||||||
16 | 14-11-20 | Prod 5 | HP | desktop | 870 | 990 | Shop D | West | Mike B | 48 | 41760 | 47520 | 5760 | 0 | 1 | ||||||||||||||
17 | 18-11-20 | Prod 7 | Samsung | laptop | 650 | 780 | Shop D | West | Mike B | 72 | 46800 | 56160 | 9360 | 1 | 1 | ||||||||||||||
18 | 25-11-20 | Prod 3 | Samsung | phone | 230 | 240 | Shop A | East | John S | 71 | 16330 | 17040 | 710 | 1 | 1 | ||||||||||||||
19 | 17-12-20 | Prod 5 | HP | desktop | 870 | 990 | Shop F | South | Steve J | 67 | 58290 | 66330 | 8040 | 0 | 0 | ||||||||||||||
20 | 28-12-20 | Prod 5 | HP | desktop | 870 | 990 | Shop E | North | Bill T | 10 | 8700 | 9900 | 1200 | 0 | 0 | ||||||||||||||
21 | 03-01-21 | Prod 4 | Apple | phone | 350 | 370 | Shop B | West | David M | 68 | 23800 | 25160 | 1360 | 1 | 2 | ||||||||||||||
22 | 14-01-21 | Prod 3 | Samsung | phone | 230 | 240 | Shop B | West | David M | 52 | 11960 | 12480 | 520 | 1 | 1 | ||||||||||||||
23 | 20-01-21 | Prod 1 | Apple | tablet | 280 | 350 | Shop B | West | David M | 60 | 16800 | 21000 | 4200 | 1 | 1 | ||||||||||||||
24 | 30-01-21 | Prod 5 | HP | desktop | 870 | 990 | Shop B | West | David M | 85 | 73950 | 84150 | 10200 | 1 | 2 | ||||||||||||||
25 | 18-02-21 | Prod 4 | Apple | phone | 350 | 370 | Shop A | East | John S | 46 | 16100 | 17020 | 920 | 0 | 0 | ||||||||||||||
26 | 20-02-21 | Prod 2 | HP | laptop | 520 | 620 | Shop A | East | John S | 35 | 18200 | 21700 | 3500 | 0 | 1 | ||||||||||||||
27 | 28-02-21 | Prod 5 | HP | desktop | 870 | 990 | Shop A | East | John S | 71 | 61770 | 70290 | 8520 | 1 | 2 | ||||||||||||||
28 | 01-03-21 | Prod 6 | Samsung | tablet | 170 | 185 | Shop E | North | Bill T | 65 | 11050 | 12025 | 975 | 0 | 0 | ||||||||||||||
29 | 04-03-21 | Prod 4 | Apple | phone | 350 | 370 | Shop E | North | Bill T | 42 | 14700 | 15540 | 840 | 0 | 0 | ||||||||||||||
30 | 06-03-21 | Prod 3 | Samsung | phone | 230 | 240 | Shop E | North | Bill T | 81 | 18630 | 19440 | 810 | 0 | 1 | ||||||||||||||
31 | 17-03-21 | Prod 4 | Apple | phone | 350 | 370 | Shop B | West | David M | 47 | 16450 | 17390 | 940 | 0 | 0 | ||||||||||||||
32 | 20-03-21 | Prod 5 | HP | desktop | 870 | 990 | Shop F | South | Steve J | 70 | 60900 | 69300 | 8400 | 0 | 1 | ||||||||||||||
33 | 22-03-21 | Prod 3 | Samsung | phone | 230 | 240 | Shop D | West | Mike B | 14 | 3220 | 3360 | 140 | 0 | 0 | ||||||||||||||
34 | 29-03-21 | Prod 6 | Samsung | tablet | 170 | 185 | Shop D | West | Mike B | 63 | 10710 | 11655 | 945 | 1 | 1 | ||||||||||||||
35 | 09-04-21 | Prod 8 | Apple | laptop | 420 | 510 | Shop A | East | John S | 50 | 21000 | 25500 | 4500 | 1 | 1 | ||||||||||||||
36 | 10-04-21 | Prod 6 | Samsung | tablet | 170 | 185 | Shop E | North | Bill T | 31 | 5270 | 5735 | 465 | 0 | 1 | ||||||||||||||
37 | 10-04-21 | Prod 5 | HP | desktop | 870 | 990 | Shop A | East | John S | 47 | 40890 | 46530 | 5640 | 0 | 1 | ||||||||||||||
38 | 10-04-21 | Prod 7 | Samsung | laptop | 650 | 780 | Shop F | South | Steve J | 12 | 7800 | 9360 | 1560 | 0 | 1 | ||||||||||||||
39 | 12-04-21 | Prod 1 | Apple | tablet | 280 | 350 | Shop A | East | John S | 51 | 14280 | 17850 | 3570 | 1 | 1 | ||||||||||||||
40 | 24-04-21 | Prod 3 | Samsung | phone | 230 | 240 | Shop F | South | Steve J | 20 | 4600 | 4800 | 200 | 0 | 1 | ||||||||||||||
41 | 28-04-21 | Prod 3 | Samsung | phone | 230 | 240 | Shop E | North | Bill T | 70 | 16100 | 16800 | 700 | 0 | 0 | ||||||||||||||
42 | 02-05-21 | Prod 8 | Apple | laptop | 420 | 510 | Shop B | West | David M | 73 | 30660 | 37230 | 6570 | 0 | 1 | ||||||||||||||
43 | 04-05-21 | Prod 3 | Samsung | phone | 230 | 240 | Shop F | South | Steve J | 19 | 4370 | 4560 | 190 | 0 | 0 | ||||||||||||||
44 | 06-05-21 | Prod 5 | HP | desktop | 870 | 990 | Shop D | West | Mike B | 28 | 24360 | 27720 | 3360 | 0 | 0 | ||||||||||||||
45 | 10-05-21 | Prod 3 | Samsung | phone | 230 | 240 | Shop A | East | John S | 38 | 8740 | 9120 | 380 | 0 | 0 | ||||||||||||||
46 | 11-05-21 | Prod 2 | HP | laptop | 520 | 620 | Shop D | West | Mike B | 35 | 18200 | 21700 | 3500 | 0 | 0 | ||||||||||||||
47 | 12-05-21 | Prod 3 | Samsung | phone | 230 | 240 | Shop A | East | John S | 43 | 9890 | 10320 | 430 | 0 | 0 | ||||||||||||||
48 | 13-05-21 | Prod 5 | HP | desktop | 870 | 990 | Shop E | North | Bill T | 10 | 8700 | 9900 | 1200 | 0 | 0 | ||||||||||||||
49 | 16-05-21 | Prod 3 | Samsung | phone | 230 | 240 | Shop E | North | Bill T | 29 | 6670 | 6960 | 290 | 0 | 1 | ||||||||||||||
50 | 12-06-21 | Prod 2 | HP | laptop | 520 | 620 | Shop F | South | Steve J | 44 | 22880 | 27280 | 4400 | 0 | 1 | ||||||||||||||
51 | 26-06-21 | Prod 8 | Apple | laptop | 420 | 510 | Shop F | South | Steve J | 50 | 21000 | 25500 | 4500 | 0 | 1 | ||||||||||||||
52 | 29-06-21 | Prod 2 | HP | laptop | 520 | 620 | Shop D | West | Mike B | 37 | 19240 | 22940 | 3700 | 0 | 0 | ||||||||||||||
53 | |||||||||||||||||||||||||||||
54 | additional records | -we can harcode any complex conditions we need | |||||||||||||||||||||||||||
55 | 01-09-20 | Prod 3 | Samsung | phone | 230 | 300 | Shop F | South | Steve J | 14 | 3220 | 4200 | 980 | (as seen in ADVFLT with help of boolean logic) | |||||||||||||||
56 | 01-09-20 | Prod 3 | Samsung | phone | 230 | 300 | Shop D | West | Mike B | 89 | 20470 | 26700 | 6230 | -if data is a table all CF behaviour updates | |||||||||||||||
57 | 14-01-21 | Prod 6 | Samsung | tablet | 170 | 240 | Shop E | North | Bill T | 83 | 14110 | 19920 | 5810 | (add additional records to the bottom of the table and everything updates) | |||||||||||||||
58 | 17-07-20 | Prod 8 | Apple | laptop | 420 | 510 | Shop C | East | John S | 43 | 18060 | 21930 | 3870 | ||||||||||||||||
59 | 09-04-21 | Prod 3 | Samsung | phone | 230 | 300 | Shop C | East | John S | 80 | 18400 | 24000 | 5600 | ||||||||||||||||
60 | 18-11-20 | Prod 1 | Apple | tablet | 280 | 350 | Shop B | West | David M | 73 | 20440 | 25550 | 5110 | ||||||||||||||||
61 | 16-07-20 | Prod 8 | Apple | laptop | 420 | 510 | Shop A | East | John S | 29 | 12180 | 14790 | 2610 | ||||||||||||||||
62 | 13-05-21 | Prod 1 | Apple | tablet | 280 | 350 | Shop B | West | David M | 84 | 23520 | 29400 | 5880 | ||||||||||||||||
63 | 18-01-21 | Prod 3 | Samsung | phone | 230 | 300 | Shop D | West | Mike B | 32 | 7360 | 9600 | 2240 | ||||||||||||||||
64 | 23-02-21 | Prod 7 | Samsung | laptop | 650 | 780 | Shop F | South | Steve J | 75 | 48750 | 58500 | 9750 | ||||||||||||||||
65 | |||||||||||||||||||||||||||||
ADVCF post |
Cell Formulas | ||
---|---|---|
Range | Formula | |
O1 | O1 | =FORMULATEXT(O3) |
Q2 | Q2 | =FORMULATEXT(Q3) |
O3:O52 | O3 | =ADVCF(S,{1,1,10},{">=1-08-20","<1-05-21",">=50"},{3,8,8},{"Apple","East","West"}) |
Q3:Q52 | Q3 | =O3#+ACOUNTIFS(TEXT(S[Date],"ddd"),{"Sat";"Sun"}) |
Dynamic array formulas. |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
A3:M52 | Expression | =$O3 | text | NO |
A3:M52 | Expression | =$Q3=2 | text | NO |
Upvote
0