第一次发布,因此excel工作表的图片将附加到超链接。
我想格式化我在P列中看到的天气数据。该列将位于第一个单元格(每月的天数”,“三个字母的月缩写”-“年份的后两位数”)。然后,按月中的每一天,将M列和E列按此顺序合并,并在其下方用逗号分隔。在每个月完成之后,我要在上面加上接下来的几个月信息(每月的天数”,“三个字母的缩写”-“年份的后两位数”)。
There is roughly 10,000 rows of data. I believe I will have to use a Macro or Conditional Formatting but do not know how to write this out. The row insert is not important as long as I can drag the formula down the column and still get the right corresponding Precipitation and Temperature Average numbers with the dates.
In cell P1, enter the formula:
=IF(ISNUMBER($C1),$M1&","&$E1,TEXT(DATE(YEAR($C2),MONTH($C2)+1,0),"d,mmm-yy"))
Then copy cell P1 and paste it to all the other cells in column P.
它的工作方式是该IF
函数检查C列是否包含数字(例如日期)。如果是这样,它将返回M和E列中的值,并在它们之间使用逗号($M1&","&$E1
)。否则,这必须是月份之间的间隔,并且您需要月份中的天数以及mmm-yy格式的数据。
该月的第一天的日期将在C列中向下排一行。该公式DATE(YEAR($C2),MONTH($C2)+1,0)
返回该月最后一天的日期(实际上是下个月的第零天,但它的工作原理是获取第二天的最后一天)这个月),然后该TEXT
函数将日期格式设置为第一个日期,然后是逗号和日期的mmm-yy部分。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句