Hello all,
Is it possible for a macro to know when to find the average by using if..else statement and for loop? I have 4 criteria before the macro computes the average. Anybody? Help is really needed here.
Thanks in Advance
Hello all,
Is it possible for a macro to know when to find the average by using if..else statement and for loop? I have 4 criteria before the macro computes the average. Anybody? Help is really needed here.
Thanks in Advance
No, it is not possible without more details
blabla,
Please explain in more detail.
Please attach your workbook, by clicking on the New Post button, then scroll down and see the Manage Attachments button.
Have a great day,
Stan
Windows 10, Excel 2007, on a PC.
If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
Hi blabla;
The short answer is yes it's possible. But nobody can help you write the macro without more information.
Some of the things people need to know:
1. How is the macro triggered? By a validation? By a button? By a menu item? or how?
2. What are the tests to decide whether to calculate the average?
3. What will the macro do with the answer after it calculates it?
Hi all,
Sorry for the limited information given. The sample i attached will explain to u in details. Hope you guys can help me out. Thanks in advance
Hi blabla;
I can not figure out what you want done.
I think you want these steps.
1) The user will enter criteria In N23:N27.
2) The user clicks "Average"
3) The macro will go to another workbook and look for the "testname" and average the #s it finds in that other workbook. A sample of the other workbook is in K34:O39.
If the #s to average are in the other workbook, how can a macro in this workbook do it without the other workbooks name?
Where do yo want the result put?
What are the other criteria besides testname for?
the another workbook name is average.xls where the result should be. I want to find the average value of each testname FTL according to their month, week, result and service. So the criteria besides testname is month, week, result and service? Di you roughly get what i mean? Isit possible to use DAVERAGE? Can DAVERAGE include another workbook?
The DAVERAGE should be able to use another workbook, but I still can not understand how you expect it to work.
When the user enters testname, month, week, result2, and service, there is no problem finding the correct FTP DL, but I don't see what there is to average. Maybe if you provided average.xls it would make more sense to me.
Last edited by shg; 07-07-2010 at 08:35 PM. Reason: deleted spurious quote
Sorry for the lack of information. Thanks for your patient.
Once the macro find the correct value of FTD, the macro will then average all data that contains the same criteria. What i gave u in sample.xls(changed to average.xls) is not even half of the data.i have a few thousands of rows and there is several testname. Each testname may repeat a few times. Each testname has a FTD value depending on the speed of network. We did the testing almost everyday. And because of this we have month and week. What i want to be done is to find each testname FTD value for each month and week. In addition, i need the result2 to be 1 and service FTD.
For e.g.
IF testname = Central, service = FTD, Month = 12, Week = 45, Result2 = 1 Then
macro will compute the average of FTD in column K of average.xls
Hi blabla;
I still don't see anything to average. Column K in average.xls is Hour column. There is only 1 row with testname = "Central" and service = "FTD", and Column K on that row is 0.
Try showing us what is averaged when testname = Central, service = FTD, Month = 12, Week = 45, Result2 = 1
Sorry for being unclear.
Let's try this. Hope this works
Please go under sheet 2.
I'm sorry blabla;
I still can not see what you want averaged.
Try making more sheets:
Sheet 1 - shows blank user entry.
Sheet 2 - shows what it looks like after user types in something
Sheet 3 - shows results after user clicks button.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks