Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Could any one Explain this Formula

I received this formula via the boards awhile ago, it worked, but now it
doesn't so I'm not sure why. It simple selects via Data Validation - Drop
Down a list of employees from a Named Range "Empoyees"

My problem is that it doesn't allow me to select anyone in the Drop down,

=OFFSET(Employees,0,0,(COUNTA(Employees,"<")-1)*($F$7<""),1)


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Could any one Explain this Formula


Shouldn't it be COUNTIF not COUNTA?

=OFFSET(Employees,0,0,(COUNTIF(Employees,"<")-1)*($F$7<""),1)


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=535194

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
macropod
 
Posts: n/a
Default Could any one Explain this Formula

Hi John,

What's in cell F7? If it's empty, you probably won't get anything, since the
formula will be saying to look up 0 rows of employees.

I have no idea what the "<" is for - it seems to result in the COUNTA
formula returning at least 1, but then 1 gets deducted from the COUNTA
result. I think you'd get the same result by replacing
'(COUNTA(Employees,"<")-1)' with 'COUNTA(Employees)'. If the intention was
to include all employee rows, plus an empty row, you'd use either
'COUNTA(Employees,1)' or '(COUNTA(Employees)+1)'

Cheers


"John" wrote in message
...
I received this formula via the boards awhile ago, it worked, but now it
doesn't so I'm not sure why. It simple selects via Data Validation - Drop
Down a list of employees from a Named Range "Empoyees"

My problem is that it doesn't allow me to select anyone in the Drop down,

=OFFSET(Employees,0,0,(COUNTA(Employees,"<")-1)*($F$7<""),1)




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Could any one Explain this Formula

Thanks Guys

There is an "empty" row in my Named Range, thus I'm assuming that the -1
eliminates this empty row when I go into the drop down.

Cell F7 contains a date, in the format dd/mm/yy

I've now just shut down Excel restarted and opened up the file, and the Drop
down list now gives me the employees that I expect and I changed nothing -
strange


"macropod" wrote in message
...
Hi John,

What's in cell F7? If it's empty, you probably won't get anything, since
the
formula will be saying to look up 0 rows of employees.

I have no idea what the "<" is for - it seems to result in the COUNTA
formula returning at least 1, but then 1 gets deducted from the COUNTA
result. I think you'd get the same result by replacing
'(COUNTA(Employees,"<")-1)' with 'COUNTA(Employees)'. If the intention
was
to include all employee rows, plus an empty row, you'd use either
'COUNTA(Employees,1)' or '(COUNTA(Employees)+1)'

Cheers


"John" wrote in message
...
I received this formula via the boards awhile ago, it worked, but now it
doesn't so I'm not sure why. It simple selects via Data Validation - Drop
Down a list of employees from a Named Range "Empoyees"

My problem is that it doesn't allow me to select anyone in the Drop down,

=OFFSET(Employees,0,0,(COUNTA(Employees,"<")-1)*($F$7<""),1)






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Arvi Laanemets
 
Posts: n/a
Default Could any one Explain this Formula

Hi

This is a formula to determine a dynamic range. But somehow twisted one.

At start, the 1st parameter for OFFSET function must be a cell referense, as
it determines the starting cell on sheet, from where the returned range is
calculated. As you use the same range Employees in COUNTA too, then
obviously Employees is a range containing several cells

So the formula mus start like this
=OFFSET(Sheetname!$A$2,....

Next 2 parameters are OK, they say that the start cell for result range is
not dislocated, i.e. it remains same as determined by 1st parameter.

The 3rd parameter {(COUNTA(Employees,"<")-1)*($F$7<"") in your
example}determines the number of rows in result range, and the 4rth one the
number of returned columns. From your expression follows, that when $F$7 is
empty, an empty range (0 rows) is returned. But the rest of expression here
is problematic again. COUNTA function can't have 2 parameters at all. You
must have there either
(COUNTA(Employees)-1)
or
(COUNTIF(Employees,"<")-1)

Both expressions count all non-empty cells in range Employees, and return a
value less of it by 1. Usually -1 in formulas like this is used to take
column header out of account. P.e. when range Employees was defined as
$A$1:$A$100, and in a1 was text for column header, and there were entries
until cell A20, then the formula
=OFFSET(Sheetname!$A$2,,,COUNTA(Employees)-1,1)
returns the range A2:A20. I myself prefer to use slightly different
formyula - so the range will be not corrupted when you need to delete the
row 2.
=OFFSET(Sheetname!$A$1,1,,COUNTA(Employees)-1,1)


NB! There may be empty rows at bottom of range Employees, but the filled
range MUST be continuous - otherwise last entries are dropped from returned
range.


Arvi Laanemets


"John" wrote in message
...
I received this formula via the boards awhile ago, it worked, but now it
doesn't so I'm not sure why. It simple selects via Data Validation - Drop
Down a list of employees from a Named Range "Empoyees"

My problem is that it doesn't allow me to select anyone in the Drop down,

=OFFSET(Employees,0,0,(COUNTA(Employees,"<")-1)*($F$7<""),1)






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Could any one Explain this Formula

Arvi

Thanks for your detailed and informative reply


"Arvi Laanemets" wrote in message
...
Hi

This is a formula to determine a dynamic range. But somehow twisted one.

At start, the 1st parameter for OFFSET function must be a cell referense,
as
it determines the starting cell on sheet, from where the returned range is
calculated. As you use the same range Employees in COUNTA too, then
obviously Employees is a range containing several cells

So the formula mus start like this
=OFFSET(Sheetname!$A$2,....

Next 2 parameters are OK, they say that the start cell for result range is
not dislocated, i.e. it remains same as determined by 1st parameter.

The 3rd parameter {(COUNTA(Employees,"<")-1)*($F$7<"") in your
example}determines the number of rows in result range, and the 4rth one
the
number of returned columns. From your expression follows, that when $F$7
is
empty, an empty range (0 rows) is returned. But the rest of expression
here
is problematic again. COUNTA function can't have 2 parameters at all. You
must have there either
(COUNTA(Employees)-1)
or
(COUNTIF(Employees,"<")-1)

Both expressions count all non-empty cells in range Employees, and return
a
value less of it by 1. Usually -1 in formulas like this is used to take
column header out of account. P.e. when range Employees was defined as
$A$1:$A$100, and in a1 was text for column header, and there were entries
until cell A20, then the formula
=OFFSET(Sheetname!$A$2,,,COUNTA(Employees)-1,1)
returns the range A2:A20. I myself prefer to use slightly different
formyula - so the range will be not corrupted when you need to delete the
row 2.
=OFFSET(Sheetname!$A$1,1,,COUNTA(Employees)-1,1)


NB! There may be empty rows at bottom of range Employees, but the filled
range MUST be continuous - otherwise last entries are dropped from
returned
range.


Arvi Laanemets


"John" wrote in message
...
I received this formula via the boards awhile ago, it worked, but now it
doesn't so I'm not sure why. It simple selects via Data Validation - Drop
Down a list of employees from a Named Range "Empoyees"

My problem is that it doesn't allow me to select anyone in the Drop down,

=OFFSET(Employees,0,0,(COUNTA(Employees,"<")-1)*($F$7<""),1)






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Could any one Explain this Formula

Arvi

One query is it correct that you can't reference another sheet within Data
Validation criteria (other than the one I am on)?


"Arvi Laanemets" wrote in message
...
Hi

This is a formula to determine a dynamic range. But somehow twisted one.

At start, the 1st parameter for OFFSET function must be a cell referense,
as
it determines the starting cell on sheet, from where the returned range is
calculated. As you use the same range Employees in COUNTA too, then
obviously Employees is a range containing several cells

So the formula mus start like this
=OFFSET(Sheetname!$A$2,....

Next 2 parameters are OK, they say that the start cell for result range is
not dislocated, i.e. it remains same as determined by 1st parameter.

The 3rd parameter {(COUNTA(Employees,"<")-1)*($F$7<"") in your
example}determines the number of rows in result range, and the 4rth one
the
number of returned columns. From your expression follows, that when $F$7
is
empty, an empty range (0 rows) is returned. But the rest of expression
here
is problematic again. COUNTA function can't have 2 parameters at all. You
must have there either
(COUNTA(Employees)-1)
or
(COUNTIF(Employees,"<")-1)

Both expressions count all non-empty cells in range Employees, and return
a
value less of it by 1. Usually -1 in formulas like this is used to take
column header out of account. P.e. when range Employees was defined as
$A$1:$A$100, and in a1 was text for column header, and there were entries
until cell A20, then the formula
=OFFSET(Sheetname!$A$2,,,COUNTA(Employees)-1,1)
returns the range A2:A20. I myself prefer to use slightly different
formyula - so the range will be not corrupted when you need to delete the
row 2.
=OFFSET(Sheetname!$A$1,1,,COUNTA(Employees)-1,1)


NB! There may be empty rows at bottom of range Employees, but the filled
range MUST be continuous - otherwise last entries are dropped from
returned
range.


Arvi Laanemets


"John" wrote in message
...
I received this formula via the boards awhile ago, it worked, but now it
doesn't so I'm not sure why. It simple selects via Data Validation - Drop
Down a list of employees from a Named Range "Empoyees"

My problem is that it doesn't allow me to select anyone in the Drop down,

=OFFSET(Employees,0,0,(COUNTA(Employees,"<")-1)*($F$7<""),1)






  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Arvi Laanemets
 
Posts: n/a
Default Could any one Explain this Formula

Hi

Yes, you can. But you have to define the range you are referring to as a
named range, and use it. P.e. you define a named range MyRange as
=OFFSET(Sheetname!$A$1,1,,COUNTA(Sheetname!$A:$A)-1,1)
now you can anywhere in your workbook create data validation list(s) with
source
=MyRange


Arvi Laanemets


"John" wrote in message
...
Arvi

One query is it correct that you can't reference another sheet within Data
Validation criteria (other than the one I am on)?


"Arvi Laanemets" wrote in message
...
Hi

This is a formula to determine a dynamic range. But somehow twisted one.

At start, the 1st parameter for OFFSET function must be a cell

referense,
as
it determines the starting cell on sheet, from where the returned range

is
calculated. As you use the same range Employees in COUNTA too, then
obviously Employees is a range containing several cells

So the formula mus start like this
=OFFSET(Sheetname!$A$2,....

Next 2 parameters are OK, they say that the start cell for result range

is
not dislocated, i.e. it remains same as determined by 1st parameter.

The 3rd parameter {(COUNTA(Employees,"<")-1)*($F$7<"") in your
example}determines the number of rows in result range, and the 4rth one
the
number of returned columns. From your expression follows, that when $F$7
is
empty, an empty range (0 rows) is returned. But the rest of expression
here
is problematic again. COUNTA function can't have 2 parameters at all.

You
must have there either
(COUNTA(Employees)-1)
or
(COUNTIF(Employees,"<")-1)

Both expressions count all non-empty cells in range Employees, and

return
a
value less of it by 1. Usually -1 in formulas like this is used to take
column header out of account. P.e. when range Employees was defined as
$A$1:$A$100, and in a1 was text for column header, and there were

entries
until cell A20, then the formula
=OFFSET(Sheetname!$A$2,,,COUNTA(Employees)-1,1)
returns the range A2:A20. I myself prefer to use slightly different
formyula - so the range will be not corrupted when you need to delete

the
row 2.
=OFFSET(Sheetname!$A$1,1,,COUNTA(Employees)-1,1)


NB! There may be empty rows at bottom of range Employees, but the filled
range MUST be continuous - otherwise last entries are dropped from
returned
range.


Arvi Laanemets


"John" wrote in message
...
I received this formula via the boards awhile ago, it worked, but now

it
doesn't so I'm not sure why. It simple selects via Data Validation -

Drop
Down a list of employees from a Named Range "Empoyees"

My problem is that it doesn't allow me to select anyone in the Drop

down,

=OFFSET(Employees,0,0,(COUNTA(Employees,"<")-1)*($F$7<""),1)








  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Could any one Explain this Formula

Hi!

One query is it correct that you can't reference another sheet within Data
Validation criteria (other than the one I am on)?


No, you can refer to other sheets but you have to do it by creating a
defined name or use the Indirect function.

Biff

"John" wrote in message
...
Arvi

One query is it correct that you can't reference another sheet within Data
Validation criteria (other than the one I am on)?


"Arvi Laanemets" wrote in message
...
Hi

This is a formula to determine a dynamic range. But somehow twisted one.

At start, the 1st parameter for OFFSET function must be a cell referense,
as
it determines the starting cell on sheet, from where the returned range
is
calculated. As you use the same range Employees in COUNTA too, then
obviously Employees is a range containing several cells

So the formula mus start like this
=OFFSET(Sheetname!$A$2,....

Next 2 parameters are OK, they say that the start cell for result range
is
not dislocated, i.e. it remains same as determined by 1st parameter.

The 3rd parameter {(COUNTA(Employees,"<")-1)*($F$7<"") in your
example}determines the number of rows in result range, and the 4rth one
the
number of returned columns. From your expression follows, that when $F$7
is
empty, an empty range (0 rows) is returned. But the rest of expression
here
is problematic again. COUNTA function can't have 2 parameters at all. You
must have there either
(COUNTA(Employees)-1)
or
(COUNTIF(Employees,"<")-1)

Both expressions count all non-empty cells in range Employees, and return
a
value less of it by 1. Usually -1 in formulas like this is used to take
column header out of account. P.e. when range Employees was defined as
$A$1:$A$100, and in a1 was text for column header, and there were entries
until cell A20, then the formula
=OFFSET(Sheetname!$A$2,,,COUNTA(Employees)-1,1)
returns the range A2:A20. I myself prefer to use slightly different
formyula - so the range will be not corrupted when you need to delete the
row 2.
=OFFSET(Sheetname!$A$1,1,,COUNTA(Employees)-1,1)


NB! There may be empty rows at bottom of range Employees, but the filled
range MUST be continuous - otherwise last entries are dropped from
returned
range.


Arvi Laanemets


"John" wrote in message
...
I received this formula via the boards awhile ago, it worked, but now it
doesn't so I'm not sure why. It simple selects via Data Validation -
Drop
Down a list of employees from a Named Range "Empoyees"

My problem is that it doesn't allow me to select anyone in the Drop
down,

=OFFSET(Employees,0,0,(COUNTA(Employees,"<")-1)*($F$7<""),1)








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
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
adding row to forumla carrera Excel Discussion (Misc queries) 9 August 23rd 05 10:24 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 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 02:44 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"