Академический Документы
Профессиональный Документы
Культура Документы
Topics:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
ighline Excel 2016 Class 06: Conditional Calculations with Excel Formulas: AND & OR Criteria
Mo Pham
59,996 103,587 K20: =SUMIFS(COGS,Region,$J20,SalesRep,K$19,Pro
111,971 130,973
106,166 77,239
126,650 81,673
h D Functions. (Because you can't copy the formula and have the criteria area adjust.)
NTA, DGET, DMAX, DMIN, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DVAR, DVARP
egion West AND is the SalesRep Gigi AND is the Product AIM Item?
SalesRep Product
=Gigi =AIM Item
K76: =DCOUNT(A1:G2000,K75,J72:N73)
K77: =DSUM(A1:G2000,K75,J72:N73)
K78: =DAVERAGE(A1:G2000,K75,J72:N73)
K79: =DSTDEV(A1:G2000,K75,J72:N73)
=$J87,IF(SalesRep=K$86,Sales)))}
gion,$J20,SalesRep,K$19,Product,$K$18)
Lower Limit
>="&K28,Date,"<="&L28) 1/1/2013
e,">="&K28,Date,"<="&L28) 2/1/2013
3/1/2013
4/1/2013
5/1/2013
6/1/2013
7/1/2013
8/1/2013
9/1/2013
MONTH function ==>> 10/1/2013
11/1/2013
12/1/2013
"<"&L44)
"<"&L45)
Yahoo OR Google?
MPRODUCT(SUMIFS(Sales,Customer,K9:K12))
MPRODUCT(COUNTIFS(Customer,K9:K12))
ERAGE(IF((Customer=K9)+(Customer=K10)+(Customer=K11)+(Customer=K12),Sales))}
ny non-zero number in logical_test argument is interpreted as TRUE. FALSE and zero are interpreted as FALSE.
ath operator used for OR Criteria. * is the math operator used for AND Criteria.
K19: =SUMIFS(Sales,Customer,K9)+SUMIFS(Sales,Customer,K10)+SUMIFS(Sales,Customer,K11)+SUM
K27: {=AVERAGE(IF((SalesRep=J25)+(Customer=K25),Sales))}
TRUE or Any non-zero number in logical_test argument is interpreted as TRUE. FALSE and zero are inte
+ is the math operator used for OR Criteria. * is the math operator used for AND Criteria.
ctions. (Because you can't copy the formula and have the criteria area adjust.)
GET, DMAX, DMIN, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DVAR, DVARP
d Names!!!!
ation on (either name of field or relative position amongst other field names, eg: for sales enter "Sales" or 7).
Must include comparative Operator (for equal sign use lead apostrophe, like: '=West).
Yahoo OR Google?
K50: =DSUM(A1:G2000,"Sales",K45:K49)
K52: =DCOUNTA(A1:G2000,K45,K45:K49)
UNTA(A1:G2000,J56,J56:K58)
0 U1: =SUM(U2)
Count Transactions
FS(Sales,Customer,K11)+SUMIFS(Sales,Customer,K12)
Count Transactions
TRUE. FALSE and zero are interpreted as FALSE. Count Transactions
d for AND Criteria.
NTIFS(SalesRep,J25)+COUNTIFS(Customer,K25)...
S(Customer,K25)-COUNTIFS(SalesRep,J25,Customer,K25)
ia removes the Double Count
he AVERAGE function.
Example of AND Criteria Array Operation
=AVERAGE(IF({TRUE;FALSE;FALSE;TRUE;FALSE} +{
=AVERAGE(IF({1;1;0;1;0},{6279;9428;7417;6270;
Check:
7,326
Example where OR Criteria is looking at two columns (we have to worry about Double Coun
Check:
6,027
E7: {=STDEV.S(IF(A4:A10=E4,IF(B4:B10=F4,C4:C10)))}
RUE;TRUE;FALSE;FALSE;TRUE;TRUE;FALSE},IF({TRUE;FALSE;FALSE;TRUE;TRUE;FALSE;FALSE},{6279;9428;741
E19: {=AVERAGE(IF((A15:A19=E15)+(A15:A19=E16),B15:B19))}
TRUE;FALSE;FALSE;TRUE;FALSE} +{FALSE;TRUE;FALSE;FALSE;FALSE},{6279;9428;7417;6270;5610}))
1;1;0;1;0},{6279;9428;7417;6270;5610}))
E23: =AVERAGE(B15,B16,B18)
E31: {=AVERAGE(IF((A28:A34=E28)+(B28:B34=F28),C28:C34))}
TRUE;TRUE;FALSE;FALSE;TRUE;TRUE;FALSE} +{TRUE;FALSE;FALSE;TRUE;TRUE;FALSE;FALSE},{6279;9428;74
2;1;0;1;2;1;0},{6279;9428;7417;6270;5610;2546;1987}))
E37: =AVERAGE(C28,C29,C31,C32,C33)
E},{6279;9428;7417;6270;5610;2546;1987})))
Check:
473 M10: =STDEV.S(C4,C8)
270;5610}))
SE},{6279;9428;7417;6270;5610;2546;1987}))
Our job in the AR Department is to access whether we should extend credit to customers.
Rule #1: Sales Last Year >$250,000 AND Asset Value >$300,000 AND Credit Rating
Rule #2: At least 1 of the credit ratings is exceeded.
Sales Last Year >$250,000 AND Asset Value >$300,000 AND Late Paymen
Rule #3: 0-5 is exceeded.
Sales Last Late Payments Credit
Year Asset Value Last Year Rating 1
$250,000 $300,000 2 3
Customer Information:
Sales Last Late Payments Credit
Name Year Asset Value Last Year Rating 1
Birch Stores Inc. $250,000 $370,000 2.4
RAD Web Design $430,313 $392,808 4 3.1
Blue Acorn Design $280,396 $111,622 2 2.7
Shark Logistics Co. $280,306 $370,448 1 4
Foggy Camel Vacations $454,172 $369,208 3.5
Battalion's Moving Inc. $270,797 $277,251 1 2.9
G11: =AND(B11>$B$7,C11>$C$7,E11>=$E$7)
H11: =OR(E11>$E$7,F11>$F$7)
I11: =AND(B11>$B$7,C11>$C$7,D11<$D$7,OR
J11: =IF(AND(B11>$B$7,C11>$C$7,D11<$D$7
end credit to customers.
$300,000 AND Credit Rating 1 >=3
>$300,000 AND Late Payments Last Year < 2 AND at least one of the credit hurdles
is exceeded.
0-10
Credit
Rating 2
7
Credit
Rating 2 Rule 1 Rule 2 Rule 3 IF For Rule 3
7 0 0 0 No Credit
9 1 1 0 No Credit
7.1 0 1 0 No Credit
5 1 1 1 Credit
6.8 1 1 1 Credit
2 0 0 0 No Credit
B$7,C11>$C$7,E11>=$E$7)
$7,F11>$F$7)
B$7,C11>$C$7,D11<$D$7,OR(E11>$E$7,F11>$F$7))
$B$7,C11>$C$7,D11<$D$7,OR(E11>$E$7,F11>$F$7)),"Credit","No Credit")
Cell content Function IS Function
rad 1 ISTEXT function Text yields TRUE
23 ISTEXT function
12 1 ISNUMBER function A number yields TRUE
Rad ISNUMBER function
1 0 ISLOGICAL function A Logical yields TRUE
1 ISBLANK function An empty cell yields TRUE
#REF! 1 ISERROR function #N/A, #VALUE!, #REF!, #DIV/0!, #NUM
Err:512 1 ISERR function Any error value except #N/A yields TRU
Err:512 0 ISNA function An #N/A (value not available) yields TR
Excel 0 ISNONTEXT function Anything NOT text (number, error, emp
ISNONTEXT function
35 1 ISFORMULA A formula yields TRUE
ISBLANK
Date Check #/Trans # Description Add Subtract Balance
10/1/2013 Bal. Forward $ 5,000.00
10/3/2013 Ch. 1034 Rent $ 500.00 $ 4,500.00
10/4/2013 Dept 5458 Pay $ 950.00 $ 5,450.00
10/4/2013 Ch 100 $ 5,450.00
REF!, #DIV/0!, #NUM!, #NAME?, or #NULL! yields TRUE
cept #N/A yields TRUE
t available) yields TRUE
(number, error, empty cell) yields TRUE
ISNUMBER ISTEXT
Balance Balance
$ 5,000.00 $ 5,000.00
$ 4,500.00 $ 4,500.00
$ 5,450.00 $ 5,450.00
$ 5,450.00 $ 5,450.00
PivotTable or Formulas?
1) If the solution needs to instantly update when formula inputs or source data changes, then formula
2) If you are making aggregate calculations with many criteria and you dont need the solution to upd
3) There are more functions in an Excel spreadsheet than there are in a PivotTable.
4) PivotTable only do Aggregate Calculations.
5) For Big Data formulas calculate slowly.
6) PivotTables are easy to create.
7) Sometimes it is easier to create your solution with formulas, sometimes it is easier with a PivotTable
Sum - Sales
5301
4307
9608
UCT(B4:L4,B5:L5)
In cell B4 create a formula that can be copied through the range B4:E9 that will count how man
Sales COGS
$1,102.00 $464.00
$323.00 $136.00
$1,121.00 $472.00
$1,265.00 $605.00
$924.00 $407.00
$1,647.00 $884.50
$1,350.00 $725.00
$1,593.00 $855.50
$972.00 $522.00
$294.00 $129.50
$1,026.00 $551.00
$1,449.00 $693.00
$171.00 $72.00
$1,495.00 $715.00
$945.00 $507.50
$703.00 $296.00
$1,045.00 $440.00
$627.00 $264.00
$644.00 $308.00
$270.00 $145.00
$660.00 $300.00
$494.00 $208.00
$126.00 $55.50
$1,107.00 $594.50
$702.00 $377.00
$855.00 $360.00
$315.00 $138.75
$1,495.00 $715.00
$378.00 $203.00
$1,232.00 $560.00
$209.00 $88.00
$1,080.00 $580.00
$1,566.00 $841.00
$920.00 $440.00
$1,080.00 $580.00
$253.00 $121.00
$374.00 $170.00
$513.00 $275.50
$405.00 $217.50
$1,083.00 $456.00
$357.00 $157.25
$713.00 $341.00
$588.00 $259.00
$242.00 $110.00
$440.00 $200.00
$216.00 $116.00
$918.00 $493.00
$782.00 $374.00
$304.00 $128.00
$736.00 $352.00
$1,281.00 $564.25
$1,239.00 $545.75
$660.00 $300.00
$484.00 $220.00
$138.00 $66.00
$432.00 $232.00
$513.00 $275.50
$690.00 $330.00
$1,178.00 $496.00
$550.00 $250.00
$247.00 $104.00
$504.00 $222.00
$1,173.00 $561.00
$437.00 $184.00
$943.00 $451.00
$209.00 $88.00
$513.00 $275.50
$1,364.00 $620.00
$912.00 $384.00
$748.00 $340.00
$851.00 $407.00
$950.00 $400.00
$1,173.00 $561.00
$736.00 $352.00
$506.00 $242.00
$759.00 $363.00
$396.00 $180.00
$323.00 $136.00
$266.00 $112.00
$1,026.00 $432.00
$1,232.00 $560.00
$1,034.00 $470.00
$1,430.00 $650.00
$1,176.00 $518.00
$1,728.00 $928.00
$1,323.00 $582.75
$525.00 $231.25
$405.00 $217.50
$798.00 $336.00
$651.00 $286.75
$672.00 $296.00
$782.00 $374.00
$1,150.00 $550.00
$1,007.00 $424.00
$729.00 $391.50
$506.00 $230.00
$324.00 $174.00
$1,350.00 $725.00
$931.00 $392.00
$357.00 $157.25
$324.00 $174.00
$1,219.00 $583.00
$861.00 $379.25
$152.00 $64.00
$987.00 $434.75
e in each Region.
In cell B4 create a formula that can be copied through the range B4:E9 that will count how
Check:
Sales COGS
$1,102.00 $464.00
$323.00 $136.00
$1,121.00 $472.00
$1,265.00 $605.00
$924.00 $407.00
$1,647.00 $884.50
$1,350.00 $725.00
$1,593.00 $855.50
$972.00 $522.00
$294.00 $129.50
$1,026.00 $551.00
$1,449.00 $693.00
$171.00 $72.00
$1,495.00 $715.00
$945.00 $507.50
$703.00 $296.00
$1,045.00 $440.00
$627.00 $264.00
$644.00 $308.00
$270.00 $145.00
$660.00 $300.00
$494.00 $208.00
$126.00 $55.50
$1,107.00 $594.50
$702.00 $377.00
$855.00 $360.00
$315.00 $138.75
$1,495.00 $715.00
$378.00 $203.00
$1,232.00 $560.00
$209.00 $88.00
$1,080.00 $580.00
$1,566.00 $841.00
$920.00 $440.00
$1,080.00 $580.00
$253.00 $121.00
$374.00 $170.00
$513.00 $275.50
$405.00 $217.50
$1,083.00 $456.00
$357.00 $157.25
$713.00 $341.00
$588.00 $259.00
$242.00 $110.00
$440.00 $200.00
$216.00 $116.00
$918.00 $493.00
$782.00 $374.00
$304.00 $128.00
$736.00 $352.00
$1,281.00 $564.25
$1,239.00 $545.75
$660.00 $300.00
$484.00 $220.00
$138.00 $66.00
$432.00 $232.00
$513.00 $275.50
$690.00 $330.00
$1,178.00 $496.00
$550.00 $250.00
$247.00 $104.00
$504.00 $222.00
$1,173.00 $561.00
$437.00 $184.00
$943.00 $451.00
$209.00 $88.00
$513.00 $275.50
$1,364.00 $620.00
$912.00 $384.00
$748.00 $340.00
$851.00 $407.00
$950.00 $400.00
$1,173.00 $561.00
$736.00 $352.00
$506.00 $242.00
$759.00 $363.00
$396.00 $180.00
$323.00 $136.00
$266.00 $112.00
$1,026.00 $432.00
$1,232.00 $560.00
$1,034.00 $470.00
$1,430.00 $650.00
$1,176.00 $518.00
$1,728.00 $928.00
$1,323.00 $582.75
$525.00 $231.25
$405.00 $217.50
$798.00 $336.00
$651.00 $286.75
$672.00 $296.00
$782.00 $374.00
$1,150.00 $550.00
$1,007.00 $424.00
$729.00 $391.50
$506.00 $230.00
$324.00 $174.00
$1,350.00 $725.00
$931.00 $392.00
$357.00 $157.25
$324.00 $174.00
$1,219.00 $583.00
$861.00 $379.25
$152.00 $64.00
$987.00 $434.75
In cell B4 create a formula that can be copied through the range B4:E9 that will a
Check:
This column (F) has the Custom Number Format mmmm, yyyy
In the range G9:L19 create a formula that adds the sales reps total time on the phone for the month.
This column (F) has the Custom Number Format mmmm, yyyy
Create a formula that will say whether or not the customer gets credit. For our customers ALL criteria
credit.
Assumptions
Sales Asset Value Credit Score
$250,000.00 $900,000.00 2.5
>= >= >=
Create a formula that will say whether or not the customer gets credit. For our customers ALL criteria
credit.
Assumptions
Sales Asset Value Credit Score Extend Credit
$250,000.00 $900,000.00 2.5 No Credit
>= >= >= No Credit
No Credit
Extend Credit
No Credit
No Credit
No Credit
No Credit
No Credit
No Credit
Extend Credit
No Credit
No Credit
No Credit
No Credit
No Credit
Extend Credit
No Credit
No Credit
In the I column create a formula that calculate the balance for the checkbook. Copy the fo
the range I5:I28. Use the IF function to show a blank for rows that do not have a date
2,405.00
1,288.00
1,029.00
1,000.00
In the I column create a formula that calculate the balance for the checkbook. Copy the fo
range I5:I28. Use the IF function to show a blank for rows that do not have a date