{"id":1611,"date":"2020-10-23T01:15:17","date_gmt":"2020-10-22T18:15:17","guid":{"rendered":"https:\/\/hoctin.vn\/?p=1611"},"modified":"2020-10-23T01:15:19","modified_gmt":"2020-10-22T18:15:19","slug":"ham-weekday-trong-excel","status":"publish","type":"post","link":"https:\/\/hoctin.vn\/ham-weekday-trong-excel\/","title":{"rendered":"C\u00e1ch S\u1eed D\u1ee5ng H\u00e0m WEEKDAY Trong Excel V\u00e0 V\u00ed D\u1ee5 Chi Ti\u1ebft"},"content":{"rendered":"\t\t
Khi l\u00e0m vi\u1ec7c v\u1edbi d\u1eef li\u1ec7u ng\u00e0y th\u00e1ng trong Excel, nhi\u1ec1u l\u00fac b\u1ea1n c\u1ea7n x\u1eed l\u00fd d\u1eef li\u1ec7u ng\u00e0y th\u00e1ng \u0111\u00f3 l\u00e0 th\u1ee9 m\u1ea5y trong tu\u1ea7n, v\u00ed d\u1ee5 nh\u01b0 trong c\u00f4ng vi\u1ec7c k\u1ebf to\u00e1n, nh\u00e0 cung c\u1ea5p c\u1ee7a b\u1ea1n quy \u0111\u1ecbnh n\u1ebfu ng\u00e0y \u0111\u1ebfn h\u1ea1n thanh to\u00e1n h\u00f3a \u0111\u01a1n l\u00e0 ng\u00e0y th\u1ee9 b\u1ea3y, ch\u1ee7 nh\u1eadt th\u00ec c\u00f4ng ty b\u1ea1n ph\u1ea3i thanh to\u00e1n v\u00e0o ng\u00e0y th\u1ee9 s\u00e1u tr\u01b0\u1edbc \u0111\u00f3,…<\/span><\/span><\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t B\u1ea1n c\u00f3 th\u1ec3 x\u1eed l\u00fd nhanh t\u00ecnh hu\u1ed1ng n\u00e0y b\u1eb1ng c\u00e1ch ki\u1ec3m tra l\u1ecbch. Tuy nhi\u00ean \u0111\u1ec3 l\u1eadp k\u1ebf ho\u1ea1ch thanh to\u00e1n v\u1edbi h\u00e0ng tr\u0103m, h\u00e0ng ngh\u00ecn h\u00f3a \u0111\u01a1n, th\u00ec s\u1eed d\u1ee5ng h\u00e0m Excel \u0111\u1ec3 x\u00e1c \u0111\u1ecbnh ng\u00e0y th\u1ee9 b\u1ea3y, ch\u1ee7 nh\u1eadt ti\u1ec7n \u00edch h\u01a1n r\u1ea5t nhi\u1ec1u.<\/span><\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t H\u00e0m WEEKDAY trong Excel gi\u00fap b\u1ea1n t\u1ef1 \u0111\u1ed9ng h\u00f3a c\u00f4ng vi\u1ec7c quy \u0111\u1ed5i ng\u00e0y th\u00e1ng sang th\u1ee9 trong tu\u1ea7n.<\/span><\/span><\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t H\u00e0m WEEKDAY trong Excel l\u00e0 h\u00e0m t\u00ednh th\u1ee9 trong tu\u1ea7n, tr\u1ea3 v\u1ec1 k\u1ebft qu\u1ea3 l\u00e0 1 s\u1ed1 nguy\u00ean d\u01b0\u01a1ng, c\u00f3 c\u00fa ph\u00e1p:<\/span><\/p> =WEEKDAY(serial_number, [return_type])<\/span><\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t Trong \u0111\u00f3:<\/span><\/span><\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t V\u1edbi return_type tr\u1ed1ng ho\u1eb7c b\u1eb1ng s\u1ed1 1<\/span>: k\u1ebft qu\u1ea3 h\u00e0m l\u00e0 1 t\u01b0\u01a1ng \u1ee9ng v\u1edbi ng\u00e0y ch\u1ee7 nh\u1eadt, 2 l\u00e0 th\u1ee9 hai, \u2026, c\u1ee9 l\u1ea7n l\u01b0\u1ee3t nh\u01b0 v\u1eady cho \u0111\u1ebfn 7 \u0111\u1ea1i di\u1ec7n cho ng\u00e0y th\u1ee9 b\u1ea3y.<\/span><\/p><\/li> V\u1edbi return_type b\u1eb1ng s\u1ed1 2<\/span>: ng\u00e0y th\u1ee9 hai l\u00e0 s\u1ed1 1, th\u1ee9 ba l\u00e0 s\u1ed1 2, \u2026, ng\u00e0y ch\u1ee7 nh\u1eadt l\u00e0 s\u1ed1 7.<\/span><\/p><\/li> V\u1edbi return_type b\u1eb1ng s\u1ed1 3<\/span>: k\u1ebft qu\u1ea3 h\u00e0m WEEKDAY kh\u00f4ng c\u00f2n l\u00e0 s\u1ed1 nguy\u00ean ch\u1ea1y t\u1eeb 1 \u0111\u1ebfn 7 n\u1eefa m\u00e0 l\u00e0 t\u1eeb 0 \u0111\u1ebfn 6: ng\u00e0y th\u1ee9 hai l\u00e0 s\u1ed1 0, th\u1ee9 ba l\u00e0 s\u1ed1 1, \u2026, ng\u00e0y ch\u1ee7 nh\u1eadt l\u00e0 s\u1ed1 6.<\/span><\/p><\/li><\/ul>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t Nh\u1edd \u0111\u1ed1i s\u1ed1 Return_type, b\u1ea1n c\u00f3 th\u1ec3 t\u00f9y \u00fd th\u1ee9 n\u00e0o l\u00e0 ng\u00e0y b\u1eaft \u0111\u1ea7u tu\u1ea7n (g\u00e1n gi\u00e1 tr\u1ecb 0 ho\u1eb7c 1).<\/span><\/p> \u00a0<\/p> \u00a0<\/p> Return_type\u00a0\u00a0\u00a0<\/span><\/p><\/td> S\u1ed1 \u0111\u01b0\u1ee3c tr\u1ea3 v\u1ec1<\/span><\/p><\/td><\/tr> 1 ho\u1eb7c b\u1ecf qua<\/span><\/p><\/td> La\u0300 ca\u0301c s\u00f4\u0301 t\u01b0\u0300 1 (chu\u0309 nh\u00e2\u0323t) \u0111\u00ea\u0301n 7 (th\u01b0\u0301 ba\u0309y)<\/span><\/p><\/td><\/tr> 2<\/span><\/p><\/td> La\u0300 ca\u0301c s\u00f4\u0301 t\u01b0\u0300 1 (th\u01b0\u0301 hai) \u0111\u00ea\u0301n 7 (chu\u0309 nh\u00e2\u0323t)<\/span><\/p><\/td><\/tr> 3<\/span><\/p><\/td> La\u0300 ca\u0301c s\u00f4\u0301 t\u01b0\u0300 0 (th\u01b0\u0301 hai) \u0111\u00ea\u0301n 6 (chu\u0309 nh\u00e2\u0323t)<\/span><\/p><\/td><\/tr> 11<\/span><\/p><\/td> La\u0300 ca\u0301c s\u00f4\u0301 t\u01b0\u0300 1 (th\u01b0\u0301 hai) \u0111\u00ea\u0301n 7 (chu\u0309 nh\u00e2\u0323t)<\/span><\/p><\/td><\/tr> 12<\/span><\/p><\/td> La\u0300 ca\u0301c s\u00f4\u0301 t\u01b0\u0300 1 (th\u01b0\u0301 ba) \u0111\u00ea\u0301n 7 (th\u01b0\u0301 hai)<\/span><\/p><\/td><\/tr> 13<\/span><\/p><\/td> La\u0300 ca\u0301c s\u00f4\u0301 t\u01b0\u0300 1 (th\u01b0\u0301 t\u01b0) \u0111\u00ea\u0301n 7 (th\u01b0\u0301 ba)<\/span><\/p><\/td><\/tr> 14<\/span><\/p><\/td> La\u0300 ca\u0301c s\u00f4\u0301 t\u01b0\u0300 1 (th\u01b0\u0301 n\u0103m) \u0111\u00ea\u0301n 7 (th\u01b0\u0301 t\u01b0)<\/span><\/p><\/td><\/tr> 15<\/span><\/p><\/td> La\u0300 ca\u0301c s\u00f4\u0301 t\u01b0\u0300 1 (th\u01b0\u0301 sa\u0301u) \u0111\u00ea\u0301n 7 (th\u01b0\u0301 n\u0103m)<\/span><\/p><\/td><\/tr> 16<\/span><\/p><\/td> La\u0300 ca\u0301c s\u00f4\u0301 t\u01b0\u0300 1 (th\u01b0\u0301 ba\u0309y) \u0111\u00ea\u0301n 7 (th\u01b0\u0301 sa\u0301u)<\/span><\/p><\/td><\/tr> 17<\/span><\/p><\/td> La\u0300 ca\u0301c s\u00f4\u0301 t\u01b0\u0300 1 (chu\u0309 nh\u00e2\u0323t) \u0111\u00ea\u0301n 7 (th\u01b0\u0301 ba\u0309y)<\/span><\/p><\/td><\/tr><\/tbody><\/table><\/div>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t1, C\u00fa Ph\u00e1p H\u00e0m WEEKDAY<\/span><\/span><\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
C\u1ea7n l\u01b0u \u00fd k\u1ebft qu\u1ea3 c\u1ee7a h\u00e0m WEEKDAY tr\u1ea3 v\u1ec1 th\u1ee9 trong tu\u1ea7n \u1edf d\u1ea1ng gi\u00e1 tr\u1ecb s\u1ed1 t\u1eeb 1 \u0111\u1ebfn 7 ho\u1eb7c t\u1eeb 0 \u0111\u1ebfn 6 (t\u00f9y v\u00e0o return_type b\u1ea1n ch\u1ecdn cho c\u00f4ng th\u1ee9c h\u00e0m). M\u1ed7i gi\u00e1 tr\u1ecb s\u1ed1 \u1edf k\u1ebft qu\u1ea3 h\u00e0m WEEKDAY \u0111\u1ea1i di\u1ec7n cho m\u1ed9t ng\u00e0y trong tu\u1ea7n.<\/span><\/span>
V\u00ed d\u1ee5:<\/span><\/span><\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t<\/ul>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
C\u00e1c ki\u1ec3u gi\u00e1 tr\u1ecb \u0111\u01b0\u1ee3c tr\u1ea3 v\u1ec1 t\u01b0\u01a1ng \u1ee9ng v\u1edbi m\u1ed7i return_type c\u00f3 th\u1ec3 kh\u00f4ng d\u1ec5 d\u00e0ng \u0111\u1ec3 ghi nh\u1edb, nh\u01b0ng \u0111\u1eebng lo v\u00ec Excel c\u00f3 ch\u1ee9c n\u0103ng g\u1ee3i \u00fd c\u00fa ph\u00e1p h\u00e0m, b\u1ea1n ch\u1ec9 c\u1ea7n g\u00f5 \u201c<\/span>=weekday(gi\u00e1 tr\u1ecb ng\u00e0y,<\/span>\u201d th\u00ec Excel s\u1ebd g\u1ee3i \u00fd c\u00e1c return_type nh\u01b0 sau:<\/span><\/span><\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t2, V\u00ed D\u1ee5 Chuy\u1ec3n Ng\u00e0y Sang Th\u1ee9 Trong Excel V\u1edbi T\u1ea5t C\u1ea3 C\u00e1c Return_type<\/span><\/span><\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t