Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Formula That Counts First Value Only In Array As A Condition

I need a formula that counts the first value only in an array as the
rest of the values in the array will be the same, but does not count
all the values in the array, that is, even if the
array(column)populates. This is the formula I have now and believe that
I am close but it has to be the first value and it could populate
anywhere in the array. This is what I have so far,

=IF(COUNTIF(G14:G34,"<1.85")/COLUMN(G14:G34),1-COUNTIF(G14:G34,"<1.85")/COLUMN(G14:G34)*COUNTIF(G14:G34,"<1.85")/COLUMN(G14:G34),"").


It works if one cell in the array is populated but when more than one
cell is populated it counts the other cells. I need it to only count
the first cell only. It's a % to match formula that will work off of
the very first values that populate the array. Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Formula That Counts First Value Only In Array As A Condition

An *array-formula* expression that will find the first value in a range
is:

=INDEX(G14:G34,MIN(IF(G14:G34<"",ROW(G14:G34)-ROW(G14)+1)))

For example if I want to test if the first non-empty cell in G14:G34 is
0 and return "zero" if it is or twice the number if it is nonzero,

=IF(a,2*a,"zero")

Here a is the first non-empty cell. Then I would use the following
*array* formula:

=IF(INDEX(G14:G34,MIN(IF(G14:G34<"",ROW(G14:G34)-ROW(G14)+1))),2*INDEX(G14:G34,MIN(IF(G14:G34<"",R OW(G14:G34)-ROW(G14)+1))),"zero")

An *array* formula must be entered with the combination
Ctrl+Shift+Enter.

I based my example on yours, assuming that the COUNTIF construct
attempts to find the cell. Note that your formula will necessarily
return 0 if an element <1.85 is found.

HTH
Kostis Vezerides

wrote:
I need a formula that counts the first value only in an array as the
rest of the values in the array will be the same, but does not count
all the values in the array, that is, even if the
array(column)populates. This is the formula I have now and believe that
I am close but it has to be the first value and it could populate
anywhere in the array. This is what I have so far,

=IF(COUNTIF(G14:G34,"<1.85")/COLUMN(G14:G34),1-COUNTIF(G14:G34,"<1.85")/COLUMN(G14:G34)*COUNTIF(G14:G34,"<1.85")/COLUMN(G14:G34),"").


It works if one cell in the array is populated but when more than one
cell is populated it counts the other cells. I need it to only count
the first cell only. It's a % to match formula that will work off of
the very first values that populate the array. Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Formula That Counts First Value Only In Array As A Condition

I'm not quite sure what you're trying to calculate,
but see if this gets you pointed in the right direction:

Assuming the G14:G34 cells with values will each contain the same value or
be blank, these formulas test if that value is less than 1.85

=IF(COUNTIF(G14:G34,"<1.85")0,1/COLUMN(G14:G34),"")
Or
=IF(COUNTIF(G14:G34,"<1.85")0,MAX(G14:G34)/COLUMN(G14:G34),"")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


" wrote:

I need a formula that counts the first value only in an array as the
rest of the values in the array will be the same, but does not count
all the values in the array, that is, even if the
array(column)populates. This is the formula I have now and believe that
I am close but it has to be the first value and it could populate
anywhere in the array. This is what I have so far,

=IF(COUNTIF(G14:G34,"<1.85")/COLUMN(G14:G34),1-COUNTIF(G14:G34,"<1.85")/COLUMN(G14:G34)*COUNTIF(G14:G34,"<1.85")/COLUMN(G14:G34),"").


It works if one cell in the array is populated but when more than one
cell is populated it counts the other cells. I need it to only count
the first cell only. It's a % to match formula that will work off of
the very first values that populate the array. Thanks.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Formula That Counts First Value Only In Array As A Condition

On Jan 23, 2:43 pm, Ron Coderre
wrote:
I'm not quite sure what you're trying to calculate,
but see if this gets you pointed in the right direction:

Assuming the G14:G34 cells with values will each contain the same value or
be blank, these formulas test if that value is less than 1.85

=IF(COUNTIF(G14:G34,"<1.85")0,1/COLUMN(G14:G34),"")
Or
=IF(COUNTIF(G14:G34,"<1.85")0,MAX(G14:G34)/COLUMN(G14:G34),"")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP



" wrote:
I need a formula that counts the first value only in an array as the
rest of the values in the array will be the same, but does not count
all the values in the array, that is, even if the
array(column)populates. This is the formula I have now and believe that
I am close but it has to be the first value and it could populate
anywhere in the array. This is what I have so far,


=IF(COUNTIF(G14:G34,"<1.85")/COLUMN(G14:G34),1-COUNTIF(G14:G34,"<1.85")/COL*UMN(G14:G34)*COUNTIF(G14:G34,"<1.85")/COLUMN(G14:G34),"").


It works if one cell in the array is populated but when more than one
cell is populated it counts the other cells. I need it to only count
the first cell only. It's a % to match formula that will work off of
the very first values that populate the array. Thanks.- Hide quoted text -


- Show quoted text -


Actually I am still at it. I believe that I am almost there but I
need one more thing. I need to test for the first value in an array
based on 2 arguments. Return the first value if:

1. The value is greater than 0

2. And if the value is greater than 0, it is the same value as all
the other values in the array.

So if I have 50% for the first value that populates I want to only
return that value if the other cells in that array are 50% or blank as
well, that is if they populate at all. There will be blanks
included.

I came up with this and believe that I am close. The "=" seems to be
giving me the problem. I think that you can see what I am trying to
do by looking at the formula. Thanks again.

=IF(AND(COUNTIF(Q16:Q336,"0",Q16:Q336,"=Q16:Q336' ")/
COLUMN(Q16:Q336),MAX(Q16:Q336),""))

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
Find value in array Brook6 Excel Worksheet Functions 26 January 30th 07 09:40 PM
Use of Offset function in array formula scabHead Excel Worksheet Functions 4 December 23rd 06 01:16 AM
SUMPRODUCT clue needed Dallman Ross Excel Discussion (Misc queries) 5 September 25th 06 12:29 PM
Positioning Numeric Values Resulting from 6 Column Array Formula Sam via OfficeKB.com Excel Worksheet Functions 2 January 5th 06 02:03 AM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM


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

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"