Automatically translated.View original post

📊📆Find the date difference on Excel

1/2 Edited to

... Read moreนอกจากการหาส่วนต่างวันที่เป็น “ปี เดือน วัน” ด้วย DATEDIF แล้ว เรามักเจออีก 2 เรื่องคู่กันคือ (1) อยากแสดงวันที่-เวลาเป็นรูปแบบมาตรฐาน yyyy mm dd hh mm ss และ (2) อยาก “เปลี่ยนสีเซลล์ตามเงื่อนไขวันที่” เพื่อให้ดูสถานะงาน/เดดไลน์ง่ายขึ้น เลยสรุปทริคที่ใช้บ่อยแบบทำตามได้ทันทีค่ะ 1) สูตร DATEDIF ให้ได้ ปี/เดือน/วัน แบบอ่านง่าย ถ้ามี “วันที่เริ่มต้น” อยู่ B3 และ “วันสิ้นสุด” อยู่ C3 (ตามตัวอย่างในภาพ) เราจะคำนวณแยกเป็น 3 ส่วนแล้วค่อยนำมาต่อกัน: - ปี: =DATEDIF(B3,C3,"Y") - เดือน (เศษเดือนหลังหักปี): =DATEDIF(B3,C3,"YM") - วัน (เศษวันหลังหักปี/เดือน): =DATEDIF(B3,C3,"MD") แล้วรวมเป็นข้อความ: =DATEDIF(B3,C3,"Y")&" ปี "&DATEDIF(B3,C3,"YM")&" เดือน "&DATEDIF(B3,C3,"MD")&" วัน" ทิปส่วนตัว: ถ้ากลัววันที่เริ่มต้นมากกว่าวันสิ้นสุดจนสูตรเพี้ยน ให้ครอบด้วย IF เช่น =IF(C3<B3,"ตรวจสอบวันที่",DATEDIF(B3,C3,"Y")&" ปี "&DATEDIF(B3,C3,"YM")&" เดือน "&DATEDIF(B3,C3,"MD")&" วัน") 2) ฟอร์แมตวันที่-เวลาเป็น yyyy mm dd hh mm ss (ไม่ต้องพิมพ์สูตร) หลายคนค้นหา “yyyy mm dd hh mm ss” เพราะอยากให้ไฟล์ดูเป็นมาตรฐานเดียวกัน วิธีที่ง่ายสุดคือใช้ Format Cells: - เลือกคอลัมน์วันที่/เวลา > Ctrl+1 - Number > Custom - ใส่รูปแบบ: yyyy-mm-dd hh:mm:ss ถ้าต้องการ “แปลงเป็นข้อความ” (เช่น เอาไปทำรายงาน/ส่งระบบ) ใช้: =TEXT(A1,"yyyy-mm-dd hh:mm:ss") หมายเหตุ: ถ้าใช้ TEXT แล้วค่าจะกลายเป็น “ข้อความ” ไม่ใช่วันที่จริง การเอาไปคำนวณต่ออาจต้องระวัง 3) เปลี่ยนสีเซลล์ใน Excel ตามเงื่อนไข “วันที่” (เดดไลน์/ครบกำหนด) อันนี้ช่วยให้ตารางอ่านง่ายมาก โดยใช้ Conditional Formatting: - เลือกช่วงวันที่ (เช่น C3:C100) > Home > Conditional Formatting > New Rule > Use a formula... ตัวอย่างสูตรที่ใช้บ่อย: - วันครบกำหนด “วันนี้”: =C3=TODAY() - เลยกำหนด (เกินวันนี้): =C3<TODAY() - จะครบกำหนดภายใน 7 วัน: =AND(C3>=TODAY(),C3<=TODAY()+7) จากนั้นเลือกสีเติม (Fill) ตามที่ต้องการ เช่น เกินกำหนดเป็นแดง ใกล้ครบกำหนดเป็นเหลือง ทิป: ถ้าในเซลล์มีวัน-เวลารวมกัน (มีชั่วโมงนาทีวินาที) แนะนำเทียบแบบตัดเวลาออก: =INT(C3)=TODAY() หรือ =INT(C3)<TODAY() ลองเอา 3 ส่วนนี้ไปใช้ร่วมกับตาราง “วันที่เริ่มต้น/วันสิ้นสุด/ส่วนต่างวันที่” จะได้ทั้งคำนวณถูก แสดงผลสวย และมองสถานะได้ไวขึ้นค่ะ

Related posts

A tablet displays an Excel wedding budget spreadsheet on a desk with notes and a planner. The image is titled 'Stop Struggling with Excel Learn These Super Easy Formulas'.
This image details core Excel calculation formulas: SUM, AVERAGE, MIN, and MAX. Each function is explained with an example Excel table showing its application and purpose.
This image explains Excel's reference formulas, VLOOKUP and HLOOKUP. It provides examples with tables demonstrating how to search and retrieve data vertically and horizontally, along with usage tips.
Excel shortcuts every student should know! 👩🏻‍💻
Stop Wasting Time: Master These Excel Formulas for Maximum Efficiency! 🕒 If you’ve ever struggled with Excel, mastering formulas can seriously up your game. Here’s a breakdown of the essentials that’ll make you look like a pro 1.Core Calculation Formulas 🧮 These are the basics you can’t live
emilie.studygram

emilie.studygram

1190 likes

Excel differences in columns
Find the differences between these columns in Excel with these Excel tricks #excel #exceltraining #exceltips #excel _learning #tutorial #excel_learning #excelforbeginners #fyp
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

36 likes

Excel import magic
Excel magic at its finest. Import data from picture whether it’s a photo from your phone or a screenshot. #tutorial #exceltips #exceltricks #exceltraining #exceltutorial
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

374 likes

A laptop displays an Excel spreadsheet with charts and data, while a hand interacts with the trackpad. The image features text overlay "Excel shortcuts cheat sheet" and "SWIPE FOR MORE," indicating a guide to Excel shortcuts.
This image lists four essential Excel shortcuts: Autosize Columns (Alt + H + O + I), AutoSum (Alt + =), Display formula in cells (Ctrl + ~), and Insert Current Date (Ctrl + ;). It is part of a multi-page guide.
This image presents four more Excel shortcuts: Insert Hyperlink (Ctrl + K), Freeze Rows & Columns (Alt + W + F + F + F), Fill Down / Fill Right (Ctrl + D and Ctrl + R), and Paste Special - Values (Alt + E, S, N).
Excel shortcuts every student should know! 👩🏻‍💻
Excel shortcuts can significantly improve your efficiency and productivity when working with spreadsheets. Here are some powerful Excel shortcuts that everyone should know. These shortcuts can save you a lot of time and make working with Excel more efficient. Practice using them regularly to become
teal.days

teal.days

2721 likes

Blank Health Conditions Excel Ss for SCHOOL Nurses
As a school nurse this isn’t perfect but I wanted to share it anyways. It is a BLANK excel template for students with health conditions. Just click and request access. Is there any other templates you’d like to have access to or need ? 1. Click my link tree in my bio!!! Click on drop down arrow
Officialtiktoknurse

Officialtiktoknurse

116 likes

Excel vs Word
Excel formatting does the same thing as many people using Word #tutorial #exceltips #exceltricks #exceltutorial #exceltraining #worktips #alwayslearning
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

4948 likes

A vibrant graphic titled 'USEFUL EXCEL FORMULAS' in green, overlaid on a spreadsheet displaying various charts, data tables, and financial figures. The image includes 'Career | Lemon 8' branding and a 'SWIPE' indicator.
A laptop screen showing code, with a text box explaining the 'VLOOKUP' Excel formula. It defines its function for searching large datasets and provides a detailed example. The image is branded 'Career | Lemon 8 | Yun Jung'.
A text box on a wooden desk with a laptop, smartphone, and coffee cup, explaining 'SUMIF & SUMIFS' Excel formulas. It defines their use for adding cells based on conditions and provides a SUMIF example. The image is branded 'Career | Lemon 8 | Yun Jung'.
Useful Excel Formulas to save your time at work!
Hey everyone! Excel formulas are awesome for speeding up calculations and analyzing data. They range from simple math stuff to more complex tasks like searching and matching data. Learning these formulas can make your work easier and help you get more done in less time. Try out online tutorials and
Yun Jung

Yun Jung

874 likes

Data Analyst vs Business Analyst - The difference
Hello everyone! I often get questions on the difference between data analyst vs business analyst so wanted to share about the differences! While both involve working with data, a Data Analyst focuses on interpreting and analyzing data to provide insights, while a Business Analyst interprets those i
Yun Jung

Yun Jung

177 likes

100 Excel Tips
100 Excel Tips The best Shortcuts, Formulas, Formatting & Advanced Tips Bookmark this, you'll save 1,000 of hours! A list of tips that all professionals need. Here is a preview: ⌨️ Shortcuts 1. How to hide a column? Ctrl + 0 2. How to hide a row? Ctrl + 9 3. How to
ExpressoSolut

ExpressoSolut

1452 likes

Excel signature
Yes a handwritten signature imported in excel #exceltips #exceltricks #exceltraining #exceltutorial #excel
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

188 likes

Separate tab for excel notes
Keep your notes to yourself with excel camera #tutorial #excel #exceltraining #exceltricks #business #exceltutorial #exceltips
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

37 likes

Save these Useful Excel Shortcuts!
Hey everyone! Excel shortcuts are super helpful for getting things done faster and smoother. They range from simple tricks for moving around your spreadsheet to more advanced ones for formatting and data manipulation. Mastering these shortcuts can really save you time and make you more efficient! I
Yun Jung

Yun Jung

296 likes

A woman takes a mirror selfie, holding a coffee cup and phone, with text overlay 'EXCEL SHORT CUTS SAVE TIME & FRUSTRATION PART 1'. Abstract shapes frame the image.
A beige graphic slide explains the Excel shortcut 'SHIFT + END + DOWN' for selecting an entire column or section of data, with a 'SWIPE' indicator.
A brown graphic slide details the Excel shortcut 'CTRL + A' which selects all data in a worksheet, accompanied by a 'SWIPE' instruction.
EXCEL SHORTCUTS
These excel short-cuts are just a few that have made my excel work take a fraction of the time and genuinely changed my work life!! Working in excel can be extremely frustrating when not using the tool efficiently. Here are some crucial shortcuts to enhance your experience with Excel. CTRL + A
Peyton’s Place

Peyton’s Place

2586 likes

Excel time stamps
Yes, I said permanent time stamps #exceltips #excel #tutorial #worktips #exceltraining #exceltricks
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

54 likes

Project timeline using excel
Project timeline how to using excel #projectmanagement #excel #exceltricks #exceltutorial #tutorials
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

18 likes

A dark image shows the silhouettes of a man and a woman walking away, with the text "When You Date A Real Man" overlaid. A Lemon8 logo is in the bottom left.
White background with black text stating, "when you date a real man you'll get: 'i planned this for us'". A faint Lemon8 logo is at the bottom.
White background with black text stating, "when you date a real man you'll get 'be ready ready, i'm picking you up'". A faint Lemon8 logo is at the bottom.
Date A Real Man By These Signs You’ll Know🍸
Ladies, real Men do exist. I’m tired of other girls (keyword girls) trying to say they’re isn’t any “real men” out here in the world. HELLOOO!!!?? Whoever you attract and go for, is what you are going to get! Be strong and open-minded. Now I may have come out to strong but it needs to go through yo
Angelina

Angelina

1500 likes

How to subtract hours and format time in excel
How to subtract hours using Excel. Format time with this excel tip. #excel #exceltips #exceltricks #tutorial #exceltraining
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

39 likes

Sequence in excel or google sheets
The =SEQUENCE function in Google Sheets is a game changer for generating numbers automatically. No more typing rows manually. In this quick tutorial I’ll show you how it works and how you can use it in real projects. #googlesheets #exceltips #spreadsheettips #googlesheetstricks #datame
Sireen | Data Mentor

Sireen | Data Mentor

7 likes

Excel list comparison 🌸
So we have to use something called Planbook at work (Teacher). I think this will make me want to actually use it more, and I can see me changing it again before second semester begins lol. How cute is this?! I’d usually do random colors, but love the pink & green combo. #Planbook #
Hey 😁

Hey 😁

4460 likes

Excel vs Word #excel #exceltricks #exceltips #exceltutorial
Excel vs Word #excel #exceltricks #exceltips #exceltutorial
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

834 likes

An outdoor dining scene with people seated at tables, featuring the overlaid text "Freeze the Top Row in Excel." A purple glass is visible in the foreground on a black mesh table.
A light beige background with black text asking, "Do you ever have hundreds of rows of data and when scrolling down, you loose sight of the column header and forget which column/field is which?"
A light beige background with black text stating, "This is when freezing your top row is crucial! I will show you how!"
HOW I FREEZE THE TOP ROW IN EXCEL
The ability to freeze that first row of my column headers has been a lifesaver, allowing me to scroll through thousands of rows of data without losing sight of my column headers/fields. By simply selecting the row below the one you want to freeze, heading to the "View" tab, and clicking
Peyton’s Place

Peyton’s Place

105 likes

Why use SQL/Python for Data Analysis, (not excel?)
Hello everyone! SQL and Python are favored over Excel for data analysis due to their efficiency with large datasets and automation capabilities. Python, using libraries like Pandas, ensures reproducible workflows, while SQL handles complex data manipulations with ease in relational databases. Pytho
Yun Jung

Yun Jung

91 likes

Excel permanent timestamp
Time stamps DO NOT update when you close and reopen #excel #exceltips #templates #tutorial #exceltraining
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

23 likes

An office cubicle desk with a computer monitor, keyboard, and various personal items, including framed photos and plants. Overlay text reads 'How to List Items within one Cell in Excel', introducing a productivity tip.
A screenshot of Microsoft Excel showing a cell with '1) hello'. Text explains that pressing 'Enter' moves to the next cell, and introduces the 'ALT - Enter' shortcut to add a new line within the same cell.
A simplified Excel view demonstrating a single cell containing a multi-line list: '1) hello', '2) Hi', '3) Howdy'. Text confirms this is the result of using 'Alt - Enter' to create a list of steps within one cell.
HOW I LIST MULTIPLE LINES IN ONE CELL - EXCEL
I've discovered how to list out several items by line in a single cell by using the Alt-Enter key shortcut. I can now structure my spreadsheet in a more ideal way with this ability, and keep data that belongs together in the correct rows. I select the cell I want and type the first item. Then,
Peyton’s Place

Peyton’s Place

406 likes

Excel tutorials
Help with Excel making it super easy to learn all the tips and tricks #tutorial #exceltips #exceltraining #exceltutorial #fyp #bossmoves #spreadsheet #tiptok #nicolehullihen
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

4 likes

Excel pdf button
Add a PDF button right to your Excel file #excel #tutorial #exceltips #exceltricks #spreadsheet xecutethevision dot com
Excel tips at XecuteTheVision

Excel tips at XecuteTheVision

43 likes

ANALYZE DATA - EXCEL TOOL
Excel's Analyze Data Tool is a game-changer, simplifying the way you work with data. Say goodbye to the days of laboriously creating tables and charts and struggling with formatting intricacies. This tool automates the process, making data analysis and visualization effortless. With just a f
Peyton’s Place

Peyton’s Place

253 likes

A laptop on a desk with a gold lamp and glasses, displaying a design interface. The image is overlaid with the title 'Excel Shortcuts Part 3' in white and pink text.
A beige background with white and brown text presenting an Excel shortcut: 'F2: Edit the active cell.'
A beige background with white and brown text presenting an Excel shortcut: 'Alt + =: AutoSum selected cells.'
EXCEL SHORTCUTS PART 3
As requested, here is another excel shortcut post! Discovering the power of Excel shortcuts has been a game-changer for my productivity at work. These little keystrokes might seem insignificant, but they're the key to working smarter, not harder. From navigating vast datasets quickly to instant
Peyton’s Place

Peyton’s Place

333 likes

See more