Covert Years-Months ago date format to no of days/minutes

webcetdotin

New Member
Joined
Apr 6, 2017
Messages
1
Hi, Can anybody help me in converting this excel logic to macro or formula:

Requirement- Convert Months/Years/Days/Hours ago time to Minutes., and give ranking to it.

I Have excel file with colmn Time and Download count in column D and E, i want to find out average download time per minute with a macro or formula and give Top rank based on the most downloaded file in less time. I have excel file data as follows:

**Input Data**

Filename;TIME;DOWNLOADS
- A;3 months ago;917,599 Downloads
- B;2 years ago;296,520 Downloads
- X;5 months ago;39,695 Downloads
- Z;9 months ago;15,851 Downloads

**EXPECTING RESULTS OUTPUT:**

- SNO;Filename;TIME;DOWNLOADS;TIMEinMins;Downloads;AVGDownloads;DRank
- 1;A;3 months ago;917,599 Downloads;131400;9759;13.46449431;4
- 2;B;2 years ago;296,520 Downloads;1051200;29652;35.45123432;3
- 3;X;5 months ago;39,695 Downloads;219000;3969;55.17762661;2
- 4;Z;9 months ago;15,851 Downloads;394200;1585;248.7066246;1


**Logic:**

3 months ago uploaded File A has 917,599 Downloads. 2 years ago uploaded File B has 296,520 Downloads. I want to give the best ranking to files based on AVG DOWNLOADS/UPLOADED TIME

so i converted uploaded time to minutes with current time , avg downloads per minutes = Total no of Downloads/Total number of Minutes till now

I gave the results avg downloads to best ranking in lesser time.

**Notes:**

* Some values in Download data have comma(,)Ex;- 296,520
* Time column shows months ago or years ago or hours ago or minutes ago or seconds ago, which should be converted to minutes.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi
Recap: you have time in column D and number of downloads in column E. you want time into minutes and ave downloads per minutes.
In column H1 put = NOW()
Select column G, format cells and select number.
In column G1 put =(H1-D1)*24*60 [this will give you minutes]
In column F1 put =E1/G1 [this will give you the ave downloads per minute]
In column I1 put =RANK(F1,$F$1:$F$10000)
Highlight F1 to I1 and drag it down to the last row of your data.

If you have headers you'll need to change the row numbers.

Hope this helps
 
Upvote 0

Forum statistics

Threads
1,215,232
Messages
6,123,761
Members
449,120
Latest member
Aa2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top