Countif or sumproduct & how to use it...

yytsunamiyy

Well-known Member
Joined
Mar 17, 2008
Messages
963
Hi everyone,

I have the following table:

Excel Workbook
ABCDEFGHIJKLM
1OperatorBooking #PaxStartdateEnddateArrival locationArrival dayDeparture locationDeparture day# of ProductsHotel countRTR CountOther Count
2SALINA99535201.01.200505.01.2005PMVSaPMVMi1100
3SALINA99682202.01.200505.01.2005PMVSoPMVMi1100
4SALINA99625105.01.200506.01.2005CCSMiCCSDo1100
5MEIER97867503.01.200508.01.2005PMVMoPMVSa1100
6MEIER99035302.01.200510.01.2005PMVSoRTRMo2110
7MEIER99441407.01.200510.01.2005RTRFrRTRMo1010
8SALINA99767203.01.200511.01.2005PMVMoPMVDi1100
9MEIER99571204.01.200511.01.2005CCSDiRTRDi2110
Bookings


The complete table contains some 18720 records of individual, uniquly numbered bookings (Col. B) for the the years 2005 - 2008. There are no blank cells in the table.

Column G and I contain the German short names of the arrival / departure day, derived through the listed weekday function with the custom format "ddd".

What was easy for me was to find out the distribution of arrivals & departures by weekday for all records, giving me the following:

Excel Workbook
OPQ
1Arr. DayDep. Day
2So957866
3Mo33373296
4Di6971403
5Mi105229533
6Do433492
7Fr20342505
8Sa740625
91872018720
Bookings


Column O is again formatted with custom format "ddd"

What I am trying to find out is the following:

a) What is the distribution of arrivals and departures per weekday for each year for 2005, 2006, 2007 and 2008?

b) How many arrivals / departures did I have per month - to be in a listed Apr. 2005 - March 2008. Ideally I would need the average number per day for each month, but I can do that easily with a helper column.

c) How many arrivals / departures were from PMV / CCS / RTR / ??? (Columns F & H) for the complete period, by year and by month.

I know I could find out what I want to know through filtering / copying and so on and could write the appropriate macros to do just that, but I feel reasonably certain that it is easier to find out what I need to using formulas. I was trying to write something like = COUNTIF(G:G,AND(D2<2006, O3)) to find out a) for 2005, but simply couldn't get the syntax right.

What I would really appreciate, if I have to use sumproduct, is if someone could explain to me how it works - Excel help is not terribly helpfull there and I have seen it used for similiar questions on the board before. I just don't seem to be able to get my head around it...

I am using a german language version of XL2007 on XP. Don't worry about the language, I should be able to translate the formulas from english to german correctly.

Thank you all,

Stephan
 
Last edited:

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
No, I haven't consideredPivot tables yet.
I was going the formula route because I need to do some additional calculations with those results and prepare some graphs. I haven't worked with pivot tables much, but I remember that there were some threads here dealing with problems concerning the furher use of data in pivots...

Plus, some of the calculations I am going to prepare data through vba first (sorting, putting it in tables and so on) and I think vba and pivottable sdon't mix all that well.

Maybe I am completely mistaken...
 
Upvote 0

Forum statistics

Threads
1,215,336
Messages
6,124,330
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top