View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
DoubleZ DoubleZ is offline
external usenet poster
 
Posts: 42
Default Find previous number and find next number in column

Thanks to all of you for your help.

"Sheeloo" wrote:

Are you open to working with helper columns?
If yes then try this
Enter the formulas (including the = sign) below in the cells indicated;
D1=IF(C1="",CELL("address",C1),"")
E1=D1
F1=IF(C1<"",CELL("address",C1),"")
G1=IF(F1="",F1,"")

D2=IF(C2="",CELL("address",C1),"")
E2=IF(AND(C2="",D1=""),D2,"")
F2=IF(C2<"",CELL("address",C2),"")
G2=IF(AND(F2="",G1=""),F3,"")
and copy down...

Col E and F will have what you want...
Note: I have done limited testing so it may not work...

"DoubleZ" wrote:

In Excel 2007, in column C I have some cells that contain numbers and some
cells that are blank. In column D, for every blank cell in column C I need
to return the cell reference of the previous cell containing a number. For
instance, if C10 is 5, c11 is blank, and c12 is blank, then i need d11 to
return "$C$10" and I need d12 to also return "$C$10". D10 should be blank
since C10 contained a number.

In column E, I need to do the same thing except I need the next non-blank
cell returned rather than the previous.