在Excel数据透视表中将时间戳转换为日期

时间:2022-01-01 20:57:43

I have a pivot table which currently looks like this:

我有一个数据透视表,目前看起来像这样:

                                  No of Sales  
 Team 1
     2017-03-10T07:10:20.289Z     1
     2017-03-10T07:10:22.289Z     4
     2017-03-14T07:08:20.289Z     10

 Team 2
     2017-03-11T07:14:20.289Z     11

I want to group by the date in the timestamp and only show the date and the total for that day so it looks like this instead:

我想按时间戳中的日期分组,只显示当天的日期和总数,所以它看起来像这样:

                                  No of Sales  
 Team 1
     2017-03-10                   5
     2017-03-14                   10

 Team 2
     2017-03-11                   11

How can I do this?

我怎样才能做到这一点?

1 个解决方案

#1


0  

you can do the rest of the code, but the important part is:

你可以做其余的代码,但重要的是:

strTemp= cells(row, col).value 'this contains the date 2017-03-10T07:10:20.289Z 

strDate = split(strTemp, "T")(0)

That's it.

#1


0  

you can do the rest of the code, but the important part is:

你可以做其余的代码,但重要的是:

strTemp= cells(row, col).value 'this contains the date 2017-03-10T07:10:20.289Z 

strDate = split(strTemp, "T")(0)

That's it.