Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I need some help to make a macro that look up for values on a specific day and month to make an average. Here I show how it looks A B C Day Hour Value 01/01/05 8:00 10 01/01/05 9:00 11 01/01/05 10:00 20 02/01/05 8:00 25 03/01/05 8:00 30 The macro should be able to make an average of the day entered (01/01/05) by the user and for a second option doing it with the moth. If the day entered by the user is in the column A I need to store the value and go on to the second line to do the same, storing the value to get the average of them as an output Same with the monthly average but searching the /mm/ space Any help is welcome Im just need a hand to start |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you considered using a pivot table and grouping ont the time field. It
avoids a whole pile of messy code and gives you a lot more options... If you need help just ask... -- HTH... Jim Thomlinson "snake" wrote: Hello, I need some help to make a macro that look up for values on a specific day and month to make an average. Here I show how it looks A B C Day Hour Value 01/01/05 8:00 10 01/01/05 9:00 11 01/01/05 10:00 20 02/01/05 8:00 25 03/01/05 8:00 30 The macro should be able to make an average of the day entered (01/01/05) by the user and for a second option doing it with the moth. If the day entered by the user is in the column A I need to store the value and go on to the second line to do the same, storing the value to get the average of them as an output Same with the monthly average but searching the /mm/ space Any help is welcome Im just need a hand to start |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why use a macro? Put the test date in D1 and use
=AVERAGE(IF((YEAR(A2:A100)=YEAR(D1))*(MONTH(A2:A10 0)=MONTH(D1))*(DAY(A2:A100 )=DAY(D1)),C2:C100)) and =AVERAGE(IF((YEAR(A2:A100)=YEAR(D1))*(MONTH(A2:A10 0)=MONTH(D1)),C2:C100)) both array formulae so commit with Ctrl-Shift-Enter. -- HTH Bob Phillips "snake" wrote in message ... Hello, I need some help to make a macro that look up for values on a specific day and month to make an average. Here I show how it looks A B C ? The macro should be able to make an average of the day entered (01/01/05) by the user and for a second option doing it with the moth. If the day entered by the user is in the column A I need to store the value and go on to the second line to do the same, storing the value to get the average of them as an output Same with the monthly average but searching the /mm/ space Any help is welcome Im just need a hand to start |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Great simple solution, thank you very much
"Bob Phillips" wrote: Why use a macro? Put the test date in D1 and use =AVERAGE(IF((YEAR(A2:A100)=YEAR(D1))*(MONTH(A2:A10 0)=MONTH(D1))*(DAY(A2:A100 )=DAY(D1)),C2:C100)) and =AVERAGE(IF((YEAR(A2:A100)=YEAR(D1))*(MONTH(A2:A10 0)=MONTH(D1)),C2:C100)) both array formulae so commit with Ctrl-Shift-Enter. -- HTH Bob Phillips "snake" wrote in message ... Hello, I need some help to make a macro that look up for values on a specific day and month to make an average. Here I show how it looks A B C ? The macro should be able to make an average of the day entered (01/01/05) by the user and for a second option doing it with the moth. If the day entered by the user is in the column A I need to store the value and go on to the second line to do the same, storing the value to get the average of them as an output Same with the monthly average but searching the /mm/ space Any help is welcome Im just need a hand to start |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Daily totals from a monthly log | Excel Worksheet Functions | |||
Daily / Monthly Chart | Charts and Charting in Excel | |||
sum daily production data to monthly | Excel Worksheet Functions | |||
HOW DO I FREEZE DATA THAT CHANGES DAILY. dAILY/MONTHLY BUDGET | Excel Discussion (Misc queries) | |||
Daily,monthly total | Excel Discussion (Misc queries) |