i'm trying to come up with a yearly travel budgeting spreadsheet and show the expense by month but when the travel duration spans months, i can't figure out how not to calculate the airfare cost again.

C3 is # of people
D3 is # of weeks
E3 is Cost formula =(C3*$B$36)+(C3*((D3*7)*$B$40))
where $B$36 is airfare cost and $B$40 is daily room & board cost.

These 3 columns are repeated for every month of the year.

If the stay is two months, C3 will be 1, D3 will be 4, giving E3 to be $3900 (if $B$36 is $2500 and $B$40 is $200. Now, if I put in F3 "1" and G3 "4", I'll get the same $3900 in H3 but there's no airfare for that month since it was already charged in the previous month.

Can someone help? I guess I could do a =if(C3=0,... but I would have to nest the IF statements 12 times for every month in case the travel stay is 12 months...

Thanks!