LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
justo316
 
Posts: n/a
Default Help me write a function please?


My missus has asked me to write a function for her in Excel. I don't
know how to use Excel very well. I do think that it should be possible
though.

-*Background:*-
I have a spreadsheet with 5 worksheets representing the working days of
the week. Each worksheet contains data pertaining to every occurance of
that day for as long as it has been recorded. Each day is broken up
into hourly data.

So for example, for Monday's worksheet, you would have

COL A..............COL B........COL C
9/JAN/06........5AM.........DATA
9/JAN/06........6AM.........DATA
9/JAN/06........7AM.........DATA
-...ETC....THEN...-
2/JAN/06........5AM.........DATA
2/JAN/06........6AM.........DATA
2/JAN/06........7AM.........DATA
-...ETC....-

We are trying to create a function, -on another worksheet called
Query-. The only way I can describe what we want it to do is to do it
in psuedocode. I hope someone out there can understand it and help me!
Here goes...

-PSUEDOCODE:-

-// some variables-
runningtotal = 0;
count = 0;
month = "jan";- // these variables will eventually be cells in
worksheet Query-
day = "Monday"
time = "6am";
average = 0;

-// complicated part-
FOR EACH row in worksheet day {
IF column A contains month AND columm B = time {
runningtotal = runningtotal + column C;
count = count +1;
} -// end of IF loop-
} -// end of FOR EACH loop-

-// so once those tallys are done do the following-
average = runningtotal / count;
print average to the cell;

-// end of function-

My head is going round in circles trying to figure out how to do this
in Excel. Hope you guys can help. Thanks.


--
justo316
------------------------------------------------------------------------
justo316's Profile: http://www.excelforum.com/member.php...o&userid=30266
View this thread: http://www.excelforum.com/showthread...hreadid=499355

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function to write Weekday - Monday, Tuesday etc Shrikant Excel Discussion (Misc queries) 3 September 26th 05 11:32 AM
creating function (vba) with range arguments Fredouille Excel Worksheet Functions 2 September 12th 05 11:01 AM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"