Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Count formel. Dont like the new year

I`ve spent a few hours making this formel work for 2007. This formel works
for 2006, and I cant figure out why its giving me a hard time. Is it the
formel or could it be the worksheet?

=COUNT(IF(Data!$B$2:$B$65536=Statistikk!B$2;IF(Dat a!$G$2:$H$655360;IF(Data!$F$2:$F$65536=$A3;IF(YEA R(INT(Data!$I$2:$I$65536))=2007;IF(INT(Data!$E$2:$ E$65536)<=INT(Data!$I$2:$I$65536);Data!$G$2:$H$655 36))))))

Data in B column = name of saleperson
Data in G column = Sale amount
Data in F column = weeknumber
Data in I column = Sale date
Data in E column = Date of contact from saleperson
Data in G/H column = Sale amount

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default Count formel. Dont like the new year

What is the error/problem with the formula?
--
Brevity is the soul of wit.


"svemor" wrote:

I`ve spent a few hours making this formel work for 2007. This formel works
for 2006, and I cant figure out why its giving me a hard time. Is it the
formel or could it be the worksheet?

=COUNT(IF(Data!$B$2:$B$65536=Statistikk!B$2;IF(Dat a!$G$2:$H$655360;IF(Data!$F$2:$F$65536=$A3;IF(YEA R(INT(Data!$I$2:$I$65536))=2007;IF(INT(Data!$E$2:$ E$65536)<=INT(Data!$I$2:$I$65536);Data!$G$2:$H$655 36))))))

Data in B column = name of saleperson
Data in G column = Sale amount
Data in F column = weeknumber
Data in I column = Sale date
Data in E column = Date of contact from saleperson
Data in G/H column = Sale amount

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Count formel. Dont like the new year

Sorry...

It returns 0. But there has been sales that the formula should have counted.

/svemor

"Dave F" wrote:

What is the error/problem with the formula?
--
Brevity is the soul of wit.


"svemor" wrote:

I`ve spent a few hours making this formel work for 2007. This formel works
for 2006, and I cant figure out why its giving me a hard time. Is it the
formel or could it be the worksheet?

=COUNT(IF(Data!$B$2:$B$65536=Statistikk!B$2;IF(Dat a!$G$2:$H$655360;IF(Data!$F$2:$F$65536=$A3;IF(YEA R(INT(Data!$I$2:$I$65536))=2007;IF(INT(Data!$E$2:$ E$65536)<=INT(Data!$I$2:$I$65536);Data!$G$2:$H$655 36))))))

Data in B column = name of saleperson
Data in G column = Sale amount
Data in F column = weeknumber
Data in I column = Sale date
Data in E column = Date of contact from saleperson
Data in G/H column = Sale amount

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default Count formel. Dont like the new year

I would try something like this:

=COUNTIF(Data!$B$2:$B$65536=Statistikk!B$2)+COUNTI F(Data!$G$2:$H$655360)+COUNTIF(Data!$F$2:$F$65536 =$A3)+COUNTIF(YEAR(INT(Data!$I$2:$I$65536))=2007)+ COUNTIF(INT(Data!$E$2:$E$65536)<=INT(Data!$I$2:$I$ 65536))

I'm not sure what this portion of your formula is supposed to do:
;Data!$G$2:$H$65536))))))


Dave
--
Brevity is the soul of wit.


"svemor" wrote:

Sorry...

It returns 0. But there has been sales that the formula should have counted.

/svemor

"Dave F" wrote:

What is the error/problem with the formula?
--
Brevity is the soul of wit.


"svemor" wrote:

I`ve spent a few hours making this formel work for 2007. This formel works
for 2006, and I cant figure out why its giving me a hard time. Is it the
formel or could it be the worksheet?

=COUNT(IF(Data!$B$2:$B$65536=Statistikk!B$2;IF(Dat a!$G$2:$H$655360;IF(Data!$F$2:$F$65536=$A3;IF(YEA R(INT(Data!$I$2:$I$65536))=2007;IF(INT(Data!$E$2:$ E$65536)<=INT(Data!$I$2:$I$65536);Data!$G$2:$H$655 36))))))

Data in B column = name of saleperson
Data in G column = Sale amount
Data in F column = weeknumber
Data in I column = Sale date
Data in E column = Date of contact from saleperson
Data in G/H column = Sale amount

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Count formel. Dont like the new year

The logic of your formula, with the successive IF's, shows that you
want all conditions to hold and then count the records satisfying the
conditions. The following formula is equivalent.

=SUMPRODUCT((Data!$B$2:$B$65536=Statistikk!B$2)*(D ata!$G$2:$H$655360)*(Data!$F$2:$F$65536=$A3)*(YEA R(INT(Data!$I$2:$I$65536))=2007)*(INT(Data!$E$2:$E $65536)<=INT(Data!$I$2:$I$65536)))


Try it and see if it produces the same or other result as a starting
point. If it still does not work properly something is wrong with the
data (e.g. cells that hold text while you think they are holding a
date).

HTH
Kostis Vezerides


svemor wrote:
I`ve spent a few hours making this formel work for 2007. This formel works
for 2006, and I cant figure out why its giving me a hard time. Is it the
formel or could it be the worksheet?

=COUNT(IF(Data!$B$2:$B$65536=Statistikk!B$2;IF(Dat a!$G$2:$H$655360;IF(Data!$F$2:$F$65536=$A3;IF(YEA R(INT(Data!$I$2:$I$65536))=2007;IF(INT(Data!$E$2:$ E$65536)<=INT(Data!$I$2:$I$65536);Data!$G$2:$H$655 36))))))

Data in B column = name of saleperson
Data in G column = Sale amount
Data in F column = weeknumber
Data in I column = Sale date
Data in E column = Date of contact from saleperson
Data in G/H column = Sale amount




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default Count formel. Dont like the new year

svemor wrote...
....
=COUNT(IF(Data!$B$2:$B$65536=Statistikk!B$2;IF(Da ta!$G$2:$H$655360;
IF(Data!$F$2:$F$65536=$A3;IF(YEAR(INT(Data!$I$2:$ I$65536))=2007;
IF(INT(Data!$E$2:$E$65536)<=INT(Data!$I$2:$I$6553 6);Data!$G$2:$H$65536))))))

Data in B column = name of saleperson
Data in G column = Sale amount
Data in F column = weeknumber
Data in I column = Sale date
Data in E column = Date of contact from saleperson
Data in G/H column = Sale amount


Difficult to imagine that E# I# for any # in 2..65536 shouldn't have
generated an error upon entry. Since that's fundamental, I'd put the
array formula

=AND(Data!$E$2:$E$65536<=Data!$I$2:$I$65536)

in another cell (call it VALID), then wrap the replacement for the
formula above inside

=IF(VALID;...;"Invalid")

As for the formula above, easier to use

=IF(VALID;
SUMPRODUCT((Data!$B$2:$B$65536=Statistikk!B$2)*(Da ta!$G$2:$H$655360)
*(Data!$F$2:$F$65536=$A3)*(YEAR(Data!$I$2:$I$65536 )=2007)*Data!$G$2:$H$65536;
"Invalid")

Note that I deleted all INT calls. These are date values, and as long
as Excel displays them as dates, they're positive numbers. As positive
numbers, YEAR(INT(x)) is *ALWAYS* equal to YEAR(x). The INT calls serve
no clear purpose. As for comparing columns E and I, calling INT would
exclude all sales made on the same day as the date of contact by the
salesperson, but would include sales made, say, 2 minutes after
midnight when the date and time of contact were, say, 5 minutes before
that midnight. I'm guessing that's not what you intended.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
End of Year Dedrie Excel Worksheet Functions 3 April 4th 23 11:25 AM
count cells with year sets in a column? Brainless_in_Boston New Users to Excel 3 May 4th 06 10:12 PM
Count consecutive dates only [email protected] Excel Discussion (Misc queries) 0 May 4th 06 03:58 PM
count no. of dates in a column that falls on certain month & year RawSugar Excel Worksheet Functions 2 October 20th 05 10:50 PM
Get count of records for a particular month and year maxtrixx Excel Discussion (Misc queries) 5 April 8th 05 07:39 PM


All times are GMT +1. The time now is 11:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"