Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comparing visible values in two arrays

I'm having a problem in Excel for something that I thought would be
fairly easy to do, so I was wondering if anybody with more Excel
experience than me could help.

I have a table with four fields: Product, Sales Region, Target Sales,
Actual Sales.

I wanted a formula to calculate the proportion of all products which
hit their target. I eventually did this by using
{=SUM(IF(Dx:Dy=Cx:Cy,1,0))} and dividing by COUNT(Cx:Cy). However, I
then decided that it might be useful to find a formula which did the
same but only with visible cells, so that if I wanted to filter the
table by Sales Region, I could easily get the corresponding hit rate.

I tried using {=SUBTOTAL,(9,IF(IF(Dx:Dy=Cx:Cy,1,0)))} , but I get an
error value. Does anyone know what I'm doing wrong?

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Comparing visible values in two arrays

=SUMPRODUCT(SUBTOTAL(3,OFFSET(C1,ROW($C$2:$C$20)-ROW($C$1),,1)),--($D$2:$D$2
0$C$2:$C$20))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ps.com...
I'm having a problem in Excel for something that I thought would be
fairly easy to do, so I was wondering if anybody with more Excel
experience than me could help.

I have a table with four fields: Product, Sales Region, Target Sales,
Actual Sales.

I wanted a formula to calculate the proportion of all products which
hit their target. I eventually did this by using
{=SUM(IF(Dx:Dy=Cx:Cy,1,0))} and dividing by COUNT(Cx:Cy). However, I
then decided that it might be useful to find a formula which did the
same but only with visible cells, so that if I wanted to filter the
table by Sales Region, I could easily get the corresponding hit rate.

I tried using {=SUBTOTAL,(9,IF(IF(Dx:Dy=Cx:Cy,1,0)))} , but I get an
error value. Does anyone know what I'm doing wrong?

Thanks.



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
Arrays - declaration, adding values to arrays and calculation Maxi[_2_] Excel Programming 1 August 17th 06 04:13 PM
Comparing to Arrays [email protected] Excel Programming 0 August 31st 04 10:21 PM
Comparing to Arrays [email protected] Excel Programming 1 August 31st 04 10:09 PM
Comparing to Arrays [email protected] Excel Programming 1 August 31st 04 08:47 PM
Comparing to Arrays [email protected] Excel Programming 0 August 31st 04 07:41 PM


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

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

About Us

"It's about Microsoft Excel"