View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pierre Pierre is offline
external usenet poster
 
Posts: 193
Default looking for formula to identify next non-empty cell on another sheet

On Oct 2, 4:24 pm, "T. Valko" wrote:
"Pierre" wrote in message

oups.com...
On Oct 1, 4:34 pm, "T. Valko" wrote:





"Pierre" wrote in message


roups.com...
On Oct 1, 12:40 pm, "T. Valko" wrote:


Ok...


The data type is text, taking on an appearance such as: "06548-001",
or "85282-001".


I'm going to assume that all the entries follow the same format:


12345-123


5 digits dash 3 digits


Assume the data of interest is on Sheet1 in the range C5:C100.


You want the formula entered on each sheet in cell A1.


Try this array formula** and change "n" (in 2 places) to the appropriate
number of the item you want:


=IF(COUNTA(Sheet1!C5:C100)<n,"",TEXT(LEFT(INDEX(Sh eet1!C5:C100,SMALL(IF(She***et1!C5:C100<"",ROW(Sh eet1!C5:C100)-ROW(Sheet1!C5)+1),n)),5),"00000"))


For example, on the first sheet n would equal 1, on the second sheet n
would
equal 2, third sheet n equals 3, etc.


This formula returns a TEXT string.


** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)


--
Biff
Microsoft Excel MVP


"Pierre" wrote in message


oups.com...


On Sep 30, 10:01 pm, "T. Valko" wrote:
Do you want the address of the next non-empty cell or the value
contained
in
the next non-empty cell?


I take it C5 is the beginning of the range and you want to find the
next
cell below that that is not empty. What type of data is it, text,
numeric,
both?


You mentioned 6 sheets. Will there always be 5 entries in this range?
Are
any of the entries duplicates?


--


Biff, we'd need the value contained in the 1st non-empty cell. And on
sheet 3, the next value of the non-empty cell that it found on sheet
1.


The data type is text, taking on an appearance such as: "06548-001",
or "85282-001". Forgot to mention, on the sheet that the cells value
gets posted to, the "-001" (or last 4 characters) would have to be
stripped off, leaving just the "06548"


The range would have no duplicates, but may contain a single entry; or
as many as 20.


Thanks for your interest.
I'd use a macro, with down arrows, copy, changing sheets, paste etc..,
but when I paste the found value to the top of a sheet, it'll execute
a sql type script and refresh the data on that sheet, and may tie
things up a bit. Prefer to have a formula which would populate the
sheets all at once, and then it'd refresh on its own.


I'm just the messenger. Thanks again.


Piere- Hide quoted text -


- Show quoted text -


Biff: Recd: #NAME USING
{=IF(COUNTA(sheet '1'!C5:C100)<1,"",TEXT(LEFT(INDEX(sheet '1'!
C5:C100,SMALL(IF(sheet '1'!C5:C100<"",ROW(sheet '1'!C5:C100)-
ROW(sheet '1'!C5)
+1),1)),6),"000000"))}


3 changes:
The blank cells on sheet 1were not really blank making it unnecessary
to look for the blank cell, just conditionally formatted to represent
such. iI feel so 'toopid on that one.
Entering crtl shift enter brought up a "save as" dialogue box,
chicking enter just made it go away.
It places ' around the number 1, as in sheet '1'


Still need to look up and enter into the top of each sheet the next
"different item" in column C. Thank you for your patience.


Where do you want the pizzas sent?


Pierre


==================================


Ok...


What is the actual sheet name? Is it simply 1 or is it Sheet 1 or is it
Sheet1? If a sheet name is a number (like 1) or has spaces in it (like
Sheet
1) then to refer to that sheet you need to use apostrophes:


='1'!A1
='Sheet 1'!A1


So the "empty" cells are not really empty? If they're not empty then
*exactly* what do they contain?


the next "different item" in column C.


Hmmm...


So, is this what you have:


12345-123
12345-123 - hidden using conditional formatting
12345-123 - hidden using conditional formatting
55555-555
99999-999
99999-999 - hidden using conditional formatting
99999-999 - hidden using conditional formatting


If that's what we're really dealing with this makes things a lot more
complicated!


--
Biff
Microsoft Excel MVP- Hide quoted text -


- Show quoted text -


Biff:
It's:
123456-123
123456-123 hidden using CF
123456-123 hidden using CF
123456-123 hidden using CF
789547-123
789547-123hidden using CF
789547-123hidden using CF
789547-123hidden using CF
789547-123hidden using CF
789547-123hidden using CF
789547-123hidden using CF
065432-123
065432-123 hidden using CF
065432-123 hidden using CF
065432-123 hidden using CF
etc

6 characters, a dash, 3 characters.

Thanks.

Pierre
=============================

Ok, I'm taking the easy way out on this one.

Based on your posted sample data the range is C5:C19

Use a helper column to identify the distinct entries.

Enter this formula in D5 and copy down to D19:

=IF(COUNTIF(C$5:C5,C5)=1,ROW(),"")

Then, on each sheet enter this formula and change "n" (2 places) to indicate
which item you want:

=IF(COUNT(Sheet1!D5:D19)=n,LEFT(INDEX(Sheet1!C5:C 19,MATCH(SMALL(Sheet1!D5:*D19,n),Sheet1!D5:D19,0)) ,6),"")

So, on sheet2 n = 1
sheet3 n = 2
sheet4 n = 3
sheet5 n = 4
etc
etc

--
Biff
Microsoft Excel MVP- Hide quoted text -

- Show quoted text -


Biff, you went the extra mile. Works like a champ. Much gratitude,
yet again..

Pierre