简体   繁体   中英

How to add month and day to a numbered year in excel?

I have a column of years, 2000, 1990 > 900 (0900) > 1876 etc.... However I needed to have it in a date format eg 01/01/2000, 01/01/900 (01/01/0900). I can't work out how to do this. I can only see formulas which add days and months which are already in the format I would like. I only need it as 01/01 to input to QGIS as a csv file.

Dates are represented in Excel by real numbers. The integer part (to the left of the decimal place) is the number of days since 12/30/1899. The fractional part (to the right of the decimal place) is the fraction of the day. .5 = noon, .75 = 6pm, etc. How these numbers appear in the worksheet depends on the number format of the cell. So if your cell value is 36526 (or 1/1/2000) and the number format is "mm/dd/yyyy" you will see '01/01/2000' in the cell. If the number format is "mm/dd", you will see '01/01' in the cell.

I don't understand what you mean by "I only need it as 01/01 to input to QGIS as a csv file" but if you show me some code, and explain how the results you're getting differ from the results you want, I can probably help get you there.

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