View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tom Hutchins Tom Hutchins is offline
external usenet poster
 
Posts: 1,069
Default Working out a value within a certain month.

In B2 on the new sheet, try

=SUMPRODUCT(--('Int Hot'!$B$5:$B$22=Sheet2!$A2),--(TEXT('Int
Hot'!$C$5:$C$22,"mmmm")=Sheet2!B$1),'Int Hot'!$S$5:$S$22)

I'm matching the month based on the arrival date. You will need to adjust
the ending row in the ranges on Int Hot and replace Sheet2 with the correct
name for the new sheet. Then copy B2 across and down as needed.

Hope this helps,

Hutch

"Matt" wrote:

Hi guys,

I posted a question a few weeks ago about a spreadsheet I have been working
on for my boss. Just when I thought I was home and dry, he has asked me to
add more to it and I am now stuck again.

It is to track hotel bookings and has been inputted like this:-

The headers begin in A4 and go as follows:- (Columns I-N all have a width
of zero so they appear hidden)

A - Reservation Number
B - Source of booking (dropdown box - Choices = Web, Worldspan, Pegasus,
Galileo, Amadeus, Sabre)
C - Arrival date (in the format DD/MM/YYYY)
D - Number of nights
E - Number of people
F - Total booking value
G - Average room rate (contains formula - Total booking value divided by
number of nights - F5 divided by D5)
H - Meals included (dropdown box)
I - Room revenue (contains formula - =IF($H8="Breakfast",$E8*6," ")
J - Breakfast Revenue (contains formula - =IF($H5="Breakfast",$E5*6," ")
K - Dinner Revenue (contains formula - =IF($H5="Dinner",$E5*17.95," ")
L - Dinner, bed and breakfast revenue (contains formula -
=IF($H5="DBB",$E5*23.95," ")
M - Room only (contains formula - =IF($H5="Room only",$E5*0," ")
N - Total food revenue (contains formula - =SUM(J5:M5)*D5
O - Net room revenue (Contains formula - =IF(F5=0,"",I5/1.175)
P - Net food Revenue (contains formula - =SUM(N5/1.175)
Q - Enhance revenue
R - Total net revenue (Contains formula - =SUM(O5:Q5)
S - Comission paid (contains formula)

All of the data is then entered underneath.

Now for the new bit he wants.

On a new sheet, he want a grid to show how much commision is being paid per
month to each provider of our bookings (column B - Source)

The new sheet that needs to be added will look like this:-

Columns:- (all in row 1)

B - April
C - May
D - June
E - July
F - August
G - September
H - October
I - November
J - December
K - January
L - February
M - March

In Column A from row 2 descending down

2 - Web
3 - Worldspan
4 - Pegasus
5 - Galileo
6 - Amadeus
7 - Sabre

So with all that in place, it needs to pickup the information from the
original sheet (named "Int Hot") so that all of the commission paid to the
source named "Web" in the month of April will appear in cell B2, Worldspan in
cell B3, etc.

Hope this makes sense and thanks in advance.
Matt