Calculations on a date column formatted as text

你。 提交于 2020-02-25 04:45:29

问题


I need to calculate a sum in one column based on a date range in another.

=SUMIFS(Data!$A:$A,Data!$B:$B,">4/1/2014")

The caveat is that the date column is being loaded as text by someone else (cannot control this). And worse, I cannot create another column that does something like

=DATEVALUE($A1)

because I can't expect this person to fill that formula down every time new data is added.

My only thought is to apply a DATEVALUE to the whole column, possibly as an array formula or similar.


回答1:


This is possible by using the more clunky but extremely versatile SUMPRODUCT function:

=SUMPRODUCT((DATEVALUE(Data!$B:$B)>DATE(2014;1;4))*Data!$A:$A)

What it does is determine an array of all cells where DATEVALUE() > DATE(...) and then multiply this array of TRUE/FALSE items with your data.



来源:https://stackoverflow.com/questions/23296538/calculations-on-a-date-column-formatted-as-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!