View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Arvi Laanemets Arvi Laanemets is offline
external usenet poster
 
Posts: 510
Default Crazy Formula or Macro

Hi

At start you have to define a week. The WEEKNUM function in Excel applies to
US week system only, where even 1-day week is possible.

After you have decided about week numbering system, you have to find a
formula to calculate a week number from trip date, and enter it into
additional column.

When for every date in your table is an according week number calculated (I
myself prefer to use it in format "yyyy.ww"), then you can use SUMIF
function to calculate mileage for specific week. Or you create a pivot
table, where mileages are summed weekly. Both solutions don't need your
table to be sorted at all.


--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )



"HotRod" wrote in message
...
I'm wondering if it is possible to do the following with a formula or if I
need to create a macro. I'd prefer to stay away from the macro if
possible.


I Have a sheet that has all of my business trips on it (Sorted by Date) I
want to sum the sheet so that I get the total mileage for each week.

1) Since some weeks I travel more than others how can I determine if the
mileage belongs to week 1 or 2, for ex. One week I may have five business
trips C5:C10 and then week two, two business trips C11:C12, but the
following month it could be reversed. So How can I get another cell to SUM
the first week?


2) Is there a way to sort this out in a formula?

This is what I think I need to figure out

a) Set start date
b) Determine date ranges for week's 1 - 4
c)