You are on page 1of 29

คุณทำงานในบริษัทแห่งหนึ่งที่มีพนักงาน 100 คน

คุณต้องการเริ่มติดตามประสิทธิภาพของพนักงานของคุณและตัดสินใจติ
คุณสามารถดูตัวอย่างแผ่นงานของตัวชี้วัดประสิทธิภาพสำหรับพนักงาน
ตารางประสิทธิภาพการทำงาน

กรอกข้อมูลตามคำสั่ง
Employee Information
First กรอกชื่อจริง *Eng.)
Middle กรอกชื่อเล่น (Eng.)
Name
Last กรอกนามสกุล (Eng.)
กรอกที่อยู่ปัจุบัน
Number (Eng.)
Address Street มั่วๆได้
City
Country

กรอกค่าจ้าง พนักงานได้ค่าจ้าง 40
Hourly Rate ($) เป็ น currency USD. / ชม
Wage
ประสิทธิภาพการ
Weekend กรอกเป็ น ทำงานในสัปดาห์นั้น
multiplier (%) percentage ปกติ คือ 200%

Day Weekend Hours Finished


1/1/2018 0 9 12
1/2/2018 0 8 17
1/3/2018 0 8 14
1/4/2018 0 8 17
1/5/2018 0 7 20
1/6/2018 1 2 4
1/7/2018 1 1 2
1/8/2018 0 7 10
1/9/2018 0 7 7
1/10/2018 0 8 9
1/11/2018 0 9 12
1/12/2018 0 8 14
1/13/2018 1 0 0
1/14/2018 1 2 4
1/15/2018 0 8 10
1/16/2018 0 7 15
1/17/2018 0 7 15
1/18/2018 0 9 25
1/19/2018 0 9 17
1/20/2018 1 1 1
1/21/2018 1 1 3
1/22/2018 0 7 19
1/23/2018 0 7 13
1/24/2018 0 7 11
1/25/2018 0 8 16
1/26/2018 0 7 16
1/27/2018 1 1 2
1/28/2018 1 0 0
1/29/2018 0 8 17
1/30/2018 0 8 11
1/31/2018 0 8 16
Total
หาจำนวน
ชั่วโมงการ หาจำนวนสินค้าที่ทำ
ทำงาน สำเร็จ
น 100 คน
พนักงานของคุณและตัดสินใจติดตามผลงานของพวกเขาในเดือนมกราคม 2018
ดประสิทธิภาพสำหรับพนักงานที่มีบางตารางที่มีข้อมูลพนักงานและผลิตภัณฑ์และ

Product Information Finished:


Code XL_4digit_StudentID Output: มู
Cost ($) $ 20.00
Cost: ต้นทุ
Value ($) $ 50.00 Net: ความ
Performa
Performance
good
acceptable

bad

จงคำนวณหา Output
ของพนักงาน
value * finished
Output ($) Cost ($) Net ($) Performance
0 0

หาผลรวมของ output
ของพนักงานในเดือนนี้
คม 2018
ภัณฑ์และ

Finished: จำนวนของสินค้าที่ทำสำเร็จในวันนั้น
Output: มูลค่ารวมของสินค้าที่ทำสำเร็จทั้งหมดของพนักงานในวันนั้น (Value * Fin
Cost: ต้นทุนในการผลิตสินค้าเหล่านั้นในวันนั้น
Net: ความแตกต่างระหว่างมูลค่ากับต้นทุน
Performance: คุณภาพผลงานของพนักงานคนนั้นในวันนั้น (good, acceptable, ba
นในวันนั้น (Value * Finished)

good, acceptable, bad)


logical values: 1 FALSE

หลายฟังก์ชันเป็ นฟังก์ชันที่ใช้ค่าตรรกะบางอย่างเป็ นหนึ่งในอาร์กิวเมนต์

IF(logical_expression, value_if_true, value_if_false): depending on the logical_expression, return value_if_true

ข้อมูล กฏกำหนดให้
A= 30 ถ้า A มากกว่า B ตอบ Yes
B= 40 ในทางตรงข้ามตอบ No

Employee Information
First 0
Name Middle 0
Last 0
Number 0
Street 0
Address
City 0
Country 0
กรอกค่าจ้างเป็ น
Hourly Rate ($) currency
Wage
Weekend กรอกเป็ น
multiplier (%) percentage

Day Weekend Hours Finished Output


1/1/2018 0 9 12 $ 600.00
1/2/2018 0 8 17 $ 850.00
1/3/2018 0 8 14 $ 700.00
1/4/2018 0 8 17 $ 850.00
1/5/2018 0 7 20 $ 1,000.00
1/6/2018 1 2 4 $ 200.00
1/7/2018 1 1 2 $ 100.00
1/8/2018 0 7 10 $ 500.00
1/9/2018 0 7 7 $ 350.00
1/10/2018 0 8 9 $ 450.00
1/11/2018 0 9 12 $ 600.00
1/12/2018 0 8 14 $ 700.00
1/13/2018 1 0 0 $ -
1/14/2018 1 2 4 $ 200.00
1/15/2018 0 8 10 $ 500.00
1/16/2018 0 7 15 $ 750.00
1/17/2018 0 7 15 $ 750.00
1/18/2018 0 9 25 $ 1,250.00
1/19/2018 0 9 17 $ 850.00
1/20/2018 1 1 1 $ 50.00
1/21/2018 1 1 3 $ 150.00
1/22/2018 0 7 19 $ 950.00
1/23/2018 0 7 13 $ 650.00
1/24/2018 0 7 11 $ 550.00
1/25/2018 0 8 16 $ 800.00
1/26/2018 0 7 16 $ 800.00
1/27/2018 1 1 2 $ 100.00
1/28/2018 1 0 0 $ -
1/29/2018 0 8 17 $ 850.00
1/30/2018 0 8 11 $ 550.00
1/31/2018 0 8 16 $ 800.00
Total 187 349 $ 17,450.00
al_expression, return value_if_true when its result is TRUE, return value_if_false otherwise.

คำตอบ

Product Information
Code XL_4digit_StudentID
Cost ($) $ 20.00
Value ($) $ 50.00

Performance
good
acceptable

bad

ค่าใช้จ่ายการผลิต Product cost +


Finished x Cost Wage cost
Product cost ($) Wage cost ($) Total cost ($)
Wage cost
ชั่วโมงการทำงาน (Hours) x เรทการทำงานต่อชั่ว
และ พิจารณาว่าวันนั้นเป็ นวันหยุด (Weekend) ห
ถ้า Weekend เป็ นจริง
ให้ค่า OT เพิ่ม (คือ คูณ Weekend multipli
แต่ถ้าไม่ใช่ Weekend แล้ว ไม่มี OT
Hint: = ___ * ___ * IF(Weekend, ____, 1)
Min Total cost
Max Total cost
Average Total cost
น (Hours) x เรทการทำงานต่อชั่วโมง (Hourly Rate)
วันนั้นเป็ นวันหยุด (Weekend) หรือไม่
นจริง
พิ่ม (คือ คูณ Weekend multiplier (%) )
kend แล้ว ไม่มี OT
* IF(Weekend, ____, 1)
Nested Logical Function - IF composition IF

ข้อมูล กฏกำหนดให้
A= 30 พิมพ์ข้อมูลที่มีค่ามากที่สุด
B= 40
C= 50

เรามาช่วยกันหาประสิทธิภาพการทำงานของเราในแต่ละวันจาก กฏดังต่อไปนี้

Employee Information
First 0
Name Middle 0
Last 0
Number 0
Street 0
Address
City 0
Country 0
กรอกค่าจ้างเป็ น
Hourly Rate ($) currency
Wage
Weekend กรอกเป็ น
multiplier (%) percentage
Day Weekend Hours Finished Output ($) Cost ($)
1/1/2018 0 9 12 $600 $600
1/2/2018 0 8 17 $850 $660
1/3/2018 0 8 14 $700 $600
1/4/2018 0 8 17 $850 $660
1/5/2018 0 7 20 $1,000 $680
1/6/2018 1 2 4 $200 $240
1/7/2018 1 1 2 $100 $120
1/8/2018 0 7 10 $500 $480
1/9/2018 0 7 7 $350 $420
1/10/2018 0 8 9 $450 $500
1/11/2018 0 9 12 $600 $600
1/12/2018 0 8 14 $700 $600
1/13/2018 1 0 0 $0 $0
1/14/2018 1 2 4 $200 $240
1/15/2018 0 8 10 $500 $520
1/16/2018 0 7 15 $750 $580
1/17/2018 0 7 15 $750 $580
1/18/2018 0 9 25 $1,250 $860
1/19/2018 0 9 17 $850 $700
1/20/2018 1 1 1 $50 $100
1/21/2018 1 1 3 $150 $140
1/22/2018 0 7 19 $950 $660
1/23/2018 0 7 13 $650 $540
1/24/2018 0 7 11 $550 $500
1/25/2018 0 8 16 $800 $640
1/26/2018 0 7 16 $800 $600
1/27/2018 1 1 2 $100 $120
1/28/2018 1 0 0 $0 $0
1/29/2018 0 8 17 $850 $660
1/30/2018 0 8 11 $550 $540
1/31/2018 0 8 16 $800 $640
Total 187 349 $17,450 $14,780
IF ซ้อน IF

คำตอบ Hint
=IF(…., IF(….,"A", "C"), IF(…, "B", "C"))
=IF(C5>C6, IF(C5>C7,"A", "C"), IF(C6>C7, "B", "C"))

Product Information
Code XL_4digit_StudentID
Cost ($) $ 20.00
Value ($) $ 50.00

Performance
good
acceptable

bad

กำไรจากการผลิต
Output - Cost
Net ($) Performance Hint
IF(Net น้อยกว่า ___, ___, IF(Net น้อยกว่า ___, "acceptable", ___
, IF(C6>C7, "B", "C"))
น้อยกว่า ___, "acceptable", ___))
Combining logical values - OR, WEEKDAY
จากข้อที่ผ่านมา Column Weekend มีค่าเป็ น False หรือ True โดยเรากรอกแบบแมนนวล (hard code) ซึ่งมันลำบาก
เราสามารถทำให้ spreadsheet อัตโนมัติมากยิ่งขึ้นได้โดยใช้ formulas:
OR(logical_expression1, [logical_expression2, ...]): this is the logical operator that returns TRUE if one of the ex
are FALSE.
For example, we can determine whether a cell (e.g. A2) is equal to 21 or 22 by using the following formula: =OR
WEEKDAY(date, [type]): evaluates to the day of the week of a date. type is 1, 2 or 3.
type = 1: Sunday is day 1 and Saturday is day 7 (default)
type = 2: Monday is day 1 and Sunday is day 7
type = 3: Monday is day 0 and Sunday is day 6
To help get you started, a logical expression to test whether a date in cell B2 fell on a Monday could look like this

(1) Day 8/3/2021 weekday


8/1/2021 weekday
8/2/2021 weekday
Logical
OR Logi_expr01 3<5
Logi_expr02 5=5

Employee Information

First 0
Name
Middle 0
Last 0
Number 0
Street 0
Address
City 0
Country 0
กรอกค่าจ้างเป็ น
Hourly Rate ($) currency
Wage
Weekend กรอกเป็ น
multiplier (%) percentage
แก้ไขให้เป็ น
(2) formula
Day Weekend Hours Finished Output ($) Total Cost ($)
1/1/2018 9 12 $ 600 #VALUE!
1/2/2018 8 17 $ 850 #VALUE!
1/3/2018 8 14 $ 700 #VALUE!
1/4/2018 8 17 $ 850 #VALUE!
1/5/2018 7 20 $ 1,000 #VALUE!
1/6/2018 2 4 $ 200 #VALUE!
1/7/2018 1 2 $ 100 #VALUE!
1/8/2018 7 10 $ 500 #VALUE!
1/9/2018 7 7 $ 350 #VALUE!
1/10/2018 8 9 $ 450 #VALUE!
1/11/2018 9 12 $ 600 #VALUE!
1/12/2018 8 14 $ 700 #VALUE!
1/13/2018 0 0 $ - #VALUE!
1/14/2018 2 4 $ 200 #VALUE!
1/15/2018 8 10 $ 500 #VALUE!
1/16/2018 7 15 $ 750 #VALUE!
1/17/2018 7 15 $ 750 #VALUE!
1/18/2018 9 25 $ 1,250 #VALUE!
1/19/2018 9 17 $ 850 #VALUE!
1/20/2018 1 1 $ 50 #VALUE!
1/21/2018 1 3 $ 150 #VALUE!
1/22/2018 7 19 $ 950 #VALUE!
1/23/2018 7 13 $ 650 #VALUE!
1/24/2018 7 11 $ 550 #VALUE!
1/25/2018 8 16 $ 800 #VALUE!
1/26/2018 7 16 $ 800 #VALUE!
1/27/2018 1 2 $ 100 #VALUE!
1/28/2018 0 0 $ - #VALUE!
1/29/2018 8 17 $ 850 #VALUE!
1/30/2018 8 11 $ 550 #VALUE!
1/31/2018 8 16 $ 800 #VALUE!
Total 187 349 $ 17,450 #VALUE!
บบแมนนวล (hard code) ซึ่งมันลำบากมากเวลามีข้อมูลใหม่

rator that returns TRUE if one of the expressions is TRUE and FALSE if and only if all of them

22 by using the following formula: =OR(A2 = 21, A2 = 22).


is 1, 2 or 3.

B2 fell on a Monday could look like this: WEEKDAY(B2) = 2

นักศึกษาคิดว่าทำไมถึงตอบเลขนี้
นักศึกษาคิดว่าทำไมถึงตอบเลขนี้
นักศึกษาคิดว่าทำไมถึงตอบเลขนี้

OR(Logi_expr01, Logi_expr02) Conditional counting


เราต้องการนับจำนวน
เราสามารถนับความถี่
COUNTIF(range, crite
range: the source da
criterion: a pattern to
Product Information For example: "good"
XL_4digit_Stude For example: if B14:A
Code ntID
Cost ($) 20
Value ($) 50

Performance
good
acceptable

bad

(3) (5)
Reference จาก
ข้อก่อนหน้านี้
Net ($) Performance
#VALUE!
Hint: เช็ค Column B ว่าเป็ นวัน Saturaday หรือ
#VALUE!
Sunday ด้วย OR(), Weekday()
#VALUE!
#VALUE! = OR(WEEKDAY(B___) = ___, ___(B__) = 7)
#VALUE!
#VALUE!
#VALUE! Hint --> =OR(WEEKDAY(B39) =1, WEEKDAY(B39)=7)
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
Conditional counting - COUNTIF
เราต้องการนับจำนวนวันที่เราทำงานว่ามีประสิทธิภาพดีกี่วัน ยอมรับได้กี่วันและ ไม่ดีกี่วัน
เราสามารถนับความถี่ของข้อมูลข้อความได้ด้วย:
COUNTIF(range, criterion): count the number of times the criterion is met in the specified range.
range: the source data that is used. Typically, you'll need to use an absolute reference for this one.
criterion: a pattern to check for. It can be as simple as a string you want to match on.
For example: "good". You'll see more complex criterions in later exercises.
For example: if B14:A16 contains "good", "bad", "bad", then = COUNTIF(A14:A16, "bad") evaluates to 2.

(4) count
good good 1
bad bad
bad

นำความรู้นี้ไปนับจำนวน Performance ว่าแต่ละอย่างมีกี่วัน

KDAY(B39)=7)
ange.
s one.

aluates to 2.
Table A
Day From Amount For Person Times Sum
1/5/2017 Anneli 13.01 Dinner Anneli
3/9/2017 Dorotea 19.46 Gas Arun
3/10/2017 Dylan 13.19 Gas Dorotea
3/11/2017 Arun 15.06 Gas Dylan
4/3/2017 Dylan 16.69 Dinner
4/25/2017 Arun 23.88 Dinner For Times Sum
4/28/2017 Anneli 9.95 Drinks Dinner
5/12/2017 Dylan 20.45 Drinks Drinks
5/12/2017 Anneli 9.34 Gas Gas
5/30/2017 Dylan 8.81 Drinks
6/2/2017 Anneli 19.94 Dinner When Average
7/17/2017 Anneli 21.86 Drinks First half
Second
8/5/2017 Anneli 13.26 Drinks half
8/8/2017 Dorotea 23.29 Dinner
8/31/2017 Arun 9.68 Drinks * first half คือ วันที่อยู่ก่อน
9/4/2017 Arun 10.56 Gas
9/8/2017 Arun 11.68 Dinner
9/14/2017 Arun 8.42 Gas
9/19/2017 Dorotea 24.19 Dinner
10/14/2017 Dorotea 5.11 Drinks
10/20/2017 Anneli 17.74 Drinks
11/4/2017 Arun 10.41 Dinner
11/26/2017 Anneli 18.11 Dinner
11/27/2017 Dylan 17.27 Drinks
(1) นับความถี่ของแต่ละชื่อ (Person) ที่ปรากฏใน column From ของ Table A
Average
(2) นับความถี่ของแต่ละเหตุการณ์ (For) ที่ปรากกฏใน column From ของ Table A

Conditional sum - SUMIF


Things get a bit more complex when the range to check the criterion on is not the same as the range
This can be the case for SUMIF:
Average SUMIF(range, criterion, sum_range): evaluates to the conditional sum across a range.
range: the range on which the criterion will be checked
criterion: the pattern that will be checked, e.g. "Dylan"
sum_range: the range of values that will be summed up
For example if N17:N19 holds "Arun", "Dylan", "Dylan" and O17:O19 has 3, 4, 8, then = SUMIF(N1

For example
Arun 3 ผลรวมของ
1/7/2017 Dylan 4
Dylan 8

(3) หาผลรวม (SUM) ของ Amount ของแต่ละ Person


หาผลรวม (SUM) ของ Amount ของแต่ละ For

Conditional average - AVERAGEIF


Another interesting statistic you can calculate grouped per all the categories is the average.
You're going to be using AVERAGEIF:
AVERAGEIF(range, criterion, average_range): evaluates to the conditional average across a range.
range: the range on which the criterion will be checked
criterion: the pattern that will be checked, e.g. "Dylan"
average_range: the range of values that will be summed up
For example if N32:N34 holds "Arun", "Dylan", "Dylan" and O32:O34 has 3, 4, 8, then = AVERAGEIF(
For example
Arun 3 ค่าเฉลี่ยของของ
Dylan 4
Dylan 8
(4) หาค่าเฉลี่ย (AVERAGE) ของ Amount ของแต่ละ Person
หาค่าเฉลี่ย (AVERAGE) ของ Amount ของแต่ละ For

(5)
Advanced conditions - AVERAGEIF
Up until now, the condition was always an equality check on certain ranges. However, as specified
Equals: 1 or "= 1"
Greater than: "> 1"
Greater than or equal to: ">= 1"
Less than: "< 1"
Less than or equal to: "<= 1"
Not equal to: "<> 1"
Note that this is very similar to the comparison operators you saw earlier.
As a refresher, here's the signature of the AVERAGEIF function:
AVERAGEIF(range, criterion, average_range): evaluates to the conditional average across a range.
range: the range on which the criterion will be checked
criterion: the pattern that will be checked, e.g. "Dylan"
average_range: the range of values that will be summed up
Greater than or equal to: ">= 1"
Less than: "< 1"
Less than or equal to: "<= 1"
Not equal to: "<> 1"
Note that this is very similar to the comparison operators you saw earlier.
As a refresher, here's the signature of the AVERAGEIF function:
AVERAGEIF(range, criterion, average_range): evaluates to the conditional average across a range.
range: the range on which the criterion will be checked
criterion: the pattern that will be checked, e.g. "Dylan"
average_range: the range of values that will be summed up

For example

condition day 10/6/2017 Average of amount if Day before condition d


fix condition 13.728

reference condition 13.728


Note & ใช้เชื่อม String
ของ Table A ใช้ความรู้จากข้อก่อนๆ
ใช้ความรู้จากข้อก่อนๆ
rom ของ Table A

ot the same as the range we want the statistics for.

ss a range.

3, 4, 8, then = SUMIF(N17:N19, "Dylan", O17:O19) evaluates to 12.

ผลรวมของ Dylan คือ

es is the average.

average across a range.

3, 4, 8, then = AVERAGEIF(N32:N34, "Dylan", O32:O34) evaluates to 6.

ค่าเฉลี่ยของของ Dylan คือ

es. However, as specified in the documentation, the criterion argument can be a bit more advanced:

r.

al average across a range.


r.

al average across a range.

Day before condition day

You might also like