Find Maximum Date from the List Using Excel VBA - excel

I am try to automate one task in my Excel but at one point i am stuck and i am not able to crack it.
SO here in below image as you can see i have order order number and have multiple dates in it. so how can i find maximum date for that particular order and go to next order number and repeat the same step can anyone help me to crack it.

Related

Power Query - Best way to count data from another workbook and store the value after the data is updated?

I have a workbook containing several thousand records. Each day the raw data is refreshed by downloading a master file from a central system and saving over the existing file. I need to create something that will count the number of records that match a certain criteria (i.e. how many belong to my department) and store the number in a table each day, i.e. Monday X, Tuesday Y, Wednesday Z etc.
Many years ago a colleague developed a macro to do this by opening the source file and copying the source data into a new file, but it is also programmed to produce several other MI reports within the same macro that are no longer needed, the VBA code is extremely long and complex and the whole process takes around 2 hours each day.
I'm fairly new to Power Query, but I know I can import the data in seconds and use a simple Countif to tell me what I need to know, but obviously once the data refreshes the following day the value from the Countif will update too. Instead, I need to store the values of the previous days and weeks to retain the count in one cell and the newly refreshed value in another. It also needs to be something very simple that a complete beginner could update at the click of a button to automate the process.
Can anyone suggest the best way to do this? Thank you in advance

Calculating the most likely next outcome based on previous outcomes and % on Excel

Alright, so i'm doing this as a pet project.
Is there a way for me to get excel to calculate the most likely next outcome based on the probability of each outcome (in percentages) along with a list of previous outcomes?
So basically, instead of spitting out numbers based on the % of it happening, it want to get a number based on the % and the previous outcomes.
I've been trying to look around for this on google, but I haven't really been able to find a way to do it. Would I need to use VBA? If so, could someone point me to a what exactly I would need to do so that i can go read up on it?

generating random time entries before and after midnight Excel

I am trying to generate random time entries between two time limits in Excel. the problem i am facing is the generation works fine with the same day time calculation as soon as the time passes midnight, Excel gets confused and give me wrong values values. I need to generate random entries then match it to the closest value it has in the time series given in the sample workbook. Can anyone help me?
Workbook
Try this :
=IF(ROWS($D$10:$D10)>$F$4,"",IF(HOUR($C$4)<HOUR($C$5),TIME(RANDBETWEEN(HOUR($C$4),HOUR($C$5)-1),INDEX({0,15,30,45},RANDBETWEEN(1,4)),0),IF(HOUR($C$4)=HOUR($C$5),TIME(HOUR($C$4),INDEX({0,15,30,45},RANDBETWEEN(1,4)),0),IF(HOUR($C$4)>HOUR($C$5),TIME(IF(RANDBETWEEN(0,1)=1,RANDBETWEEN(HOUR($C$4),23),RANDBETWEEN(0,HOUR($C$5)-1)),INDEX({0,15,30,45},RANDBETWEEN(1,4)),0),1))))
Hope you can share the results.. (It'll benefit others too) (:

Calculating Multiple Averages

It's my first time posting a question to this forum. Though I have found answers here many times before, I have been unable to find a solution to my current predicament.
I work in a call center and each week I need to analyze data from the thousands of call that took place over the week. I'm new to programming in Excel-VBA but I've been able to get pretty far.
The data is produced by a third party program and the format is nigh unreadable. Much of the programming I've done so far has been geared towards making the data more organized. Now, I'd like to get into more analysis.
The data is arranged by employee number (NOT in order, though). Each employee takes several calls over the course of the week, some for which the customer takes a survey. It's the survey scores I want. I want to take the average of all the surveys for each employee and then display that average in the same row as each of the entries.
Example
The yellow highlighted area is what I want to add. Any ideas? Thanks for any help in advance!
No need for VBA. If you have the supported version of Excel you can use AVERAGEIF. If not you can use below formula.
Enter as an array formula by pressing Ctrl+Shift+Enter when exiting cell edit mode (instead of just enter).
=AVERAGE(IF($A$2:$A$13=A2,$B$2:$B$13))
Then copy down for all rows.

Calculate Total Time Sharepoint 2007

I am using a sharepoint to list to track some data. I have a column called Training Start Time which is a date/time field. Then I have another column called Training End Time. In order to get the total duration, I am using a calculated field with the following code
=TEXT([Training End Time]-[Training Start Time],"h:mm")
This will be me the total duration. What I can't figure out how to do, is make a total field which gives me all the totals added up. So if someone enters 5 hours and another person adds in 3 hours, the field I need would give as an example 8 hours. Any help would be greatly appreciated.
You should be able to do it programmatically. A similar solution that uses JSLink is present here
http://social.technet.microsoft.com/wiki/contents/articles/30317.sharepoint-2013-displaying-sum-for-calculated-column-in-a-list-view-using-jslink.aspx
AFAIK, you cannot do this OOTB solution.

Resources