เพื่อมุ่งให้เกิดคุณภาพจากการอบรมสูงสุด Excel Expert Training ให้การอบรม Excel กลุ่มเล็กๆ ไม่เกิน 6 คนทุกคนสามารถเรียนรู้ Excel อย่างใกล้ชิด จะมาคนเดียวหรือมาเป็นกลุ่มแล้วนัดวันอบรมแบบส่วนตัวก็ได้
ผู้เข้าอบรมทุกคนสามารถติดตามเนื้อหาที่อบรมได้อย่างชัดเจนจากจอภาพด้านหน้าของตัวเอง
-
หาจุดผิดเกี่ยวกับการนับวัน
ตามสูตรนี้ =IF($D2=&"","",DATEDIF($D2,TODAY()+1,"Y")&" Year"&DATEDIF($D2,TODAY()+1,"YM")&" Month "&DATEDIF($D2,TODAY()+1,"MD")&" Day")
นับอายุเมื่อเทียบกับวันนี้ จากไฟล์ตัวอย่างวันขึ้นเป็นหลักร้อย ช่วยหาจุดผิดให้ด้วยครับ (excel 2007)
-
ผมเปิดไฟล์ดู ก็ไม่เห็นว่าจะมีตรงไหนผิดปกติเลยครับ
Attachment 10059
-
ลองดูวันที่ 10 ขึ้นไปจำนวนวันจะเป็นหลักร้อยเลยครับ
Attachment 10057

Originally Posted by
เอก
-
วันนี้ลองกรอกวันที่ใหม่ปรากฏว่าผลคำตอบจากสูตรไม่เปลี่ยนวันเดือนปีตาม สงสัยexcel 2007มีปัญหา เพราะเมื่อวานผม uninstall excel 2010 แล้ว ลง excel 2007 เพราะน้องๆ เขาใช้ 2007 กัน ผมคงต้องลง excel 2007 ใหม่อีกครั้ง
ขอบคุณอาจารย์เอกมากครับที่ช่วยเช็คให้
-
สำหรับภาพนี้ ผมลองเปิดด้วย Excel 2007 (รูปแรกที่โพสก่อนหน้านี้ เปิดด้วย Excel 2010) ซึ่งก็ได้ผลลัพธ์ปกติเหมือนกันครับ
Attachment 10060
ส่วนภาพล่างนี้ เปิดด้วย Excel 2003 ครับ
Attachment 10061
-
สูตร DateDif ใน Excel 2007 จะคำนวณผลลัพธ์ต่างจาก version อื่นครับ
เดิมทีสูตรนี้ Microsoft ไม่ได้รับรู้ว่าเป็นสูตรมาตรฐาน แต่แอบทำไว้ให้ใช้กันโดยไม่ได้แสดงคำอธิบายไว้ใน Help ที่ทำไว้ให้ใช้กันนั้นเพื่อเอาใจคนที่เคยใช้ Lotus 1-2-3 เท่านั้นเอง ต่อมาสูตรนี้ก็ผลุบๆโผล่ๆแสดงให้เห็นใน Help ของ Excel version นั้นบ้าง บางทีก็หายไปไม่เห็นใน Help แต่ใช้สูตรได้
การที่สูตรนี้คำนวณให้ผลลัพธ์ใน Excel 2007 ต่างไปเพราะสูตรจะคำนวณตามแบบสูตร DateDiff ของ John Walkenbach
แต่กลับสร้างปัญหาให้กับคนใช้ Excel ที่สร้างสูตรนี้ไว้ใช้ว่ากลับให้ผลลัพธ์แตกต่างไปจากเดิม
ใน Excel 2010 ใช้สูตรนี้ได้ แต่ไม่แสดงใน Help โดยจะให้คำตอบต่างจาก Excel 2007 แต่ตรงกับ Excel รุ่นเก่าครับ
ต้องทดลองกับหลายๆช่วงระยะเวลา จะได้เห็นชัดว่าคำตอบตรงกันหรือไม่
อย่างที่ผมเคยแนะนำไว้หลายๆครั้งว่า ผมไม่แนะนำให้ใช้สูตรนี้ ขอให้หา DateDiff.xla ของ John Walkenbach มาใช้แทนดีกว่า
http://www.excelexperttraining.com/e...n/datediff.xla
-
http://spreadsheetpage.com/index.php...edif_function/
The DATEDIF FunctionCategory:
General Weirdness |
[Item URL]
The DATEDIF function calculates the difference between two dates, and expresses the result in terms of months, days, or years.
If you have Excel version 5.0 or later, you can make use of the handy DATEDIF function in your formulas. But if you want to
read about this function in the Help, you must have Excel 2000. For some reason, the function was never documented until Excel 2000. And the documentation was removed from versions that followed.
The DATEDIF function has its origins in Lotus 1-2-3. Apparently, Microsoft included it in Excel for compatibility purposes. Why is it not documented? Who knows? But it's likely that lawyers are involved.
Chip Pearson has some good information about DATEDIF at his
web site.
http://www.cpearson.com/excel/datedif.aspx
Introduction To The DATEDIF Function
The DATEDIF function computes the difference between two dates in a variety of different intervals, such as the number of years, months, or days between the dates. This function is available in all versions of Excel since at least version 5/95, but is documented in the help file only for Excel 2000. For some reason, Microsoft has decided not to document this function in any other versions.
DATEDIF is treated as the drunk cousin of the Formula family. Excel knows it lives a happy and useful life, but will not speak of it in polite conversation. Do not confuse the DATEDIF worksheet function with the DateDiff VBA function.
-
ตกลงน้องสาวที่ให้เขียนโปรแกรมexcelให้นั้น เขาเปลี่ยนไปใช้ 2010 ผมเลยลง 2010 ตามเดิม และใช้ได้ดีเหมือนที่อาจารย์เอกตรวจสอบให้ ส่วนที่มีปัญหาเข้าใจว่า excel 2007 ที่ติดตั้งในขณะที่ อัพโหลดและดาวน์โหลดเวปบิทไปด้วยเลยทำให้ การติดตั้งไม่สมบูรณ์ ผมเปลี่ยนไปใช้ตามอาจารย์สมเกียรติแนะนำแล้ว ขอขอบคุณอาจารย์เอก และอาจารย์สมเกียรติอีกครั้งครับ:yesnod:
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules