简体   繁体   中英

Difference between two dates in excel in mmddyy format

I need to find difference between two dates in excel which are in mmddyy format eg: A1 = 070114 B1 = 063015

Need to find B1-A1 in number of days

use:

=REPLACE(REPLACE(B1,5,0,"/"),3,0,"/")-REPLACE(REPLACE(A1,5,0,"/"),3,0,"/")

在此处输入图片说明

@ScottCraner 的首选解决方案,但已经写出这样的:

=DATE(RIGHT(B1,2)+2000,LEFT(B1,2),MID(B1,3,2)) - DATE(RIGHT(A1,2)+2000,LEFT(A1,2),MID(A1,3,2))

If your windows regional settings are MDY (same order) then:

=TEXT(B1,"00\/00\/00")-TEXT(A1,"00\/00\/00")

If your wrs are different, then you'll need to convert the date values to real dates first.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM