0

I have an excel file with below columns

enter image description here

I want to add duration field for each member (A and B) date wise.

In here I want data like:

UserName   Date   Duration


A          22-07-2019 2

B          22-07-2019 1

I tried below code but results are not as desired. The date field is sorted like text field (not chronological). Ex: 01-01-2020 then 01-02-2020 instead 01-01-2020 then 02-01-2020

Limey
  • 10,234
  • 2
  • 12
  • 32
Sadananda
  • 35
  • 8
  • Do you want a solution in Excel or a solution in R? Both should be trivial. If R, please also post your input data using `dput()` rather than as an image: it's not as easy to convert and image to a data frame, so please help us to help you. – Limey Mar 26 '21 at 15:31
  • I want a soulutin in R. I'm reading this table from excel file – Sadananda Mar 26 '21 at 15:34
  • @Wimpel, Thanks. I'm able to get the sum by the solution given by you. But The dates are sorted like text not by date. – Sadananda Mar 26 '21 at 15:38
  • 1
    then you should convert them to data-format first... For example using `as.Date()` or one of the many many other possibilities to convert strings to dates/posix. – Wimpel Mar 26 '21 at 15:43

0 Answers0