Sorting with 'IF' statement..

  • Thread starter Thread starter Steve Kay
  • Start date Start date
S

Steve Kay

Hello,

I am working with a large excel sheet. Column H is a list
of countries about 25-35 different countries. Each
country has mutliple Lines of data. For example: Cell
(H15) has USA listed. AS well as (H16-H19).. each line
has about 20 date points listed (one per column). The
excel sheet is now line 400 rows... and getting
bigger... I currently summarize the number of times a
country is posted on another worksheet with this
equstion -- =SUMPRODUCT((WorkingCopy!H15:H19>=DATE
(2003,6,1))*(WorkingCopy!H15:H19<=DATE(2003,6,31))) --
If you notice I only know how to select the cells by
counting in Collumn H. This equatin adds up the number of
dates that fall in June for those 4 rows. I keep retyping
this for each set of rows in H and other columns. Is
there an easier way? (of course there is .. I just do not
know it).. Maybe say IF Column H has 'USA' then
=SUMPRODUCT((WorkingCopy!>=DATE(2003,6,1))*(WorkingCopy!
<=DATE(2003,6,31))) to count us the dates??? Thanks.. I
hope this isnt to long.. yyeeks... :-)
 
Hi Steve,

It's not exactly clear what you want to do - count certain
dates that correspond to the name of a country?

If that's the case just add another array to your current
formula for that country:

=SUMPRODUCT((range_for_the_country="USA")*
(WorkingCopy!H15:H19>=DATE(2003,6,1))*
(WorkingCopy!H15:H19<=DATE(2003,6,31)))

This function works like the same logic used in an IF
function except you don't define a TRUE or FALSE value.

Biff
 
Back
Top