Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 199
Default Help with an Excel formula please?

I have an Excel spreadsheet that contains two worksheets. The first contains
a set of data records - one row per record.

In the second worksheet, I would like to create a column which lists, in
numerical order, the row numbers of the first worksheet where the data in
column C is equal to the word 'HOME'.

I've thought of a way of doing this but it involves adding an extra hidden
column to the first worksheet which I would prefer not to do, if possible.

Can anyone please help me with a formula (an array formula perhaps?) that
will do what I want in one step.

Many thanks.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,045
Default Help with an Excel formula please?

On Wed, 9 Oct 2013 00:14:44 +0100, "Victor Delta" wrote:

I have an Excel spreadsheet that contains two worksheets. The first contains
a set of data records - one row per record.

In the second worksheet, I would like to create a column which lists, in
numerical order, the row numbers of the first worksheet where the data in
column C is equal to the word 'HOME'.

I've thought of a way of doing this but it involves adding an extra hidden
column to the first worksheet which I would prefer not to do, if possible.

Can anyone please help me with a formula (an array formula perhaps?) that
will do what I want in one step.

Many thanks.


This formula must be **array-entered**:

Sheet2!A1:
=IFERROR(SMALL((Sheet1!$C$1:$C$100="HOME")*ROW(IND IRECT("1:100")),
COUNTIF(Sheet1!$C$1:$C$100,"<HOME")+ROWS($1:1))," ")

Change all of the 100's to the highest row necessary. You could reference the entire row (Sheet1!$C:$C), but it will run more slowly
----------------------------------------

To **array-enter** a formula, after entering
the formula into the cell or formula bar, hold down
<ctrl<shift while hitting <enter. If you did this
correctly, Excel will place braces {...} around the formula.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 199
Default Help with an Excel formula please?

"Ron Rosenfeld" wrote in message
...

On Wed, 9 Oct 2013 00:14:44 +0100, "Victor Delta" wrote:

I have an Excel spreadsheet that contains two worksheets. The first
contains
a set of data records - one row per record.

In the second worksheet, I would like to create a column which lists, in
numerical order, the row numbers of the first worksheet where the data in
column C is equal to the word 'HOME'.

I've thought of a way of doing this but it involves adding an extra hidden
column to the first worksheet which I would prefer not to do, if possible.

Can anyone please help me with a formula (an array formula perhaps?) that
will do what I want in one step.

Many thanks.


This formula must be **array-entered**:

Sheet2!A1:
=IFERROR(SMALL((Sheet1!$C$1:$C$100="HOME")*ROW(IND IRECT("1:100")),
COUNTIF(Sheet1!$C$1:$C$100,"<HOME")+ROWS($1:1))," ")

Change all of the 100's to the highest row necessary. You could reference
the entire row (Sheet1!$C:$C), but it will run more slowly
----------------------------------------

To **array-enter** a formula, after entering
the formula into the cell or formula bar, hold down
<ctrl<shift while hitting <enter. If you did this
correctly, Excel will place braces {...} around the formula.

-----------------------------

Ron

Very many thanks for this. Have entered the formula as suggested by each
cell shows #NAME? - Have I done something silly?

V

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Help with an Excel formula please?

Hi Victor,

Am Wed, 9 Oct 2013 09:14:29 +0100 schrieb Victor Delta:

Very many thanks for this. Have entered the formula as suggested by each
cell shows #NAME? - Have I done something silly?


for me it works.
You can also try in Sheet2 A1:
=IFERROR(SMALL(IF(Sheet1!C$1:C$100="HOME",ROW($1:$ 100)),ROW(A1)),"")
Enter this formula also with CTRL+Shift+Enter


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 829
Default Help with an Excel formula please?

"Victor Delta" wrote:
"Ron Rosenfeld" wrote:
This formula must be **array-entered**: Sheet2!A1:
=IFERROR(SMALL((Sheet1!$C$1:$C$100="HOME")*ROW(IND IRECT("1:100")),
COUNTIF(Sheet1!$C$1:$C$100,"<HOME")+ROWS($1:1))," ")

[....]
cell shows #NAME? - Have I done something silly?


Are you using Excel 2003 or earlier?

IFERROR is for Excel 2007 and later.

One alternative is to use ISERROR. Not pretty! The form would be:

=IF(ISERROR(SMALL(...)),"",SMALL(...))

Note that the SMALL expression would be calculated twice if there is no
error.

I have not reviewed your needs to see if there is a better alternative.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,045
Default Help with an Excel formula please?

On Wed, 9 Oct 2013 09:14:29 +0100, "Victor Delta" wrote:



Very many thanks for this. Have entered the formula as suggested by each
cell shows #NAME? - Have I done something silly?

V


Possibly you have a typo, or you are using a version of Excel prior to 2007 that does not support IFERROR.

If that is the case, the following **array-entered** formula should work, as mentioned by joeu

=IF(ISERROR(SMALL((Sheet1!$C$1:$C$100="HOME")*ROW( INDIRECT("1:100")),
COUNTIF(Sheet1!$C$1:$C$100,"<HOME")+ROWS($1:1))), "",
SMALL((Sheet1!$C$1:$C$100="HOME")*ROW(INDIRECT("1: 100")),
COUNTIF(Sheet1!$C$1:$C$100,"<HOME")+ROWS($1:1)))

If that is the problem, then a variant of Hans formula should also work:

=IF(ISERROR(SMALL(IF(Sheet1!C$1:C$100="HOME",ROW($ 1:$100)),ROW(A1))),
"",SMALL(IF(Sheet1!C$1:C$100="HOME",ROW($1:$100)), ROW(A1)))


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 199
Default Help with an Excel formula please?

"joeu2004" wrote in message ...

"Victor Delta" wrote:
"Ron Rosenfeld" wrote:
This formula must be **array-entered**: Sheet2!A1:
=IFERROR(SMALL((Sheet1!$C$1:$C$100="HOME")*ROW(IND IRECT("1:100")),
COUNTIF(Sheet1!$C$1:$C$100,"<HOME")+ROWS($1:1))," ")

[....]
cell shows #NAME? - Have I done something silly?


Are you using Excel 2003 or earlier?

IFERROR is for Excel 2007 and later.

One alternative is to use ISERROR. Not pretty! The form would be:

=IF(ISERROR(SMALL(...)),"",SMALL(...))

Note that the SMALL expression would be calculated twice if there is no
error.

I have not reviewed your needs to see if there is a better alternative.

--------------------------------

Very many thanks for that. Yes, you were absolutely right, I use Excel 2003
but had forgotten to mention it - apologies.

I used your iserror version of Ron's original formula and it works just
fine.

Thanks both again,

V

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 199
Default Help with an Excel formula please?

"Ron Rosenfeld" wrote in message
...

On Wed, 9 Oct 2013 09:14:29 +0100, "Victor Delta" wrote:



Very many thanks for this. Have entered the formula as suggested by each
cell shows #NAME? - Have I done something silly?

V


Possibly you have a typo, or you are using a version of Excel prior to 2007
that does not support IFERROR.

If that is the case, the following **array-entered** formula should work, as
mentioned by joeu

=IF(ISERROR(SMALL((Sheet1!$C$1:$C$100="HOME")*ROW( INDIRECT("1:100")),
COUNTIF(Sheet1!$C$1:$C$100,"<HOME")+ROWS($1:1))), "",
SMALL((Sheet1!$C$1:$C$100="HOME")*ROW(INDIRECT("1: 100")),
COUNTIF(Sheet1!$C$1:$C$100,"<HOME")+ROWS($1:1)))

If that is the problem, then a variant of Hans formula should also work:

=IF(ISERROR(SMALL(IF(Sheet1!C$1:C$100="HOME",ROW($ 1:$100)),ROW(A1))),
"",SMALL(IF(Sheet1!C$1:C$100="HOME",ROW($1:$100)), ROW(A1)))

------------------------------

Ron

Many thanks for that.

V

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
Excel Formula Guidance. Formula need to determine if cell is popul Matt Excel Programming 0 February 19th 10 07:32 PM
Excel 2002 Formula: Urgent Conditional Formula Required Right Away - if possible blue[_2_] Excel Discussion (Misc queries) 2 July 11th 07 06:08 PM
Build excel formula using field values as text in the formula val kilbane Excel Worksheet Functions 2 April 18th 07 01:52 PM
Excel Formula Doesn't Execute (Shows formula-not the calcuation) Keys1970 Excel Discussion (Misc queries) 4 November 15th 06 02:12 PM
Excel 2002 formula displayed not value formula option not checked Dean Excel Worksheet Functions 1 February 28th 06 02:31 PM


All times are GMT +1. The time now is 06:01 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"