Given the range H5:S5, how can I have Excel return the cell address of
the first value that appears in that range.
=MATCH(1,--(H5:S5>0),0) entered as an array formula returns 4; this
value is in cell K5. How can I get that cell address returned?
Thanks.
Dave
JP - 19 Mar 2008 18:14 GMT
Sorry, if you know the range, don't you already know the first cell
address?
Or do I not understand what you need.
Does this work?
=ADDRESS(ROW(H5),COLUMN(INDEX(H5:S5,1,1)))
or
=ADDRESS(ROW(H5),COLUMN(H5))
HTH,
JP
> Given the range H5:S5, how can I have Excel return the cell address of
> the first value that appears in that range.
[quoted text clipped - 5 lines]
>
> Dave
Dave F - 19 Mar 2008 18:27 GMT
I don't think you understand my question. The first cell in that
range that has a value in it is K5. I want to know how to return that
address.
> Sorry, if you know the range, don't you already know the first cell
> address?
[quoted text clipped - 23 lines]
>
> - Show quoted text -
Dave F - 19 Mar 2008 18:43 GMT
Let me try to make this more concrete.
Given the range H5:S5, how do I return the cell address of the first
cell in that range to contain a value?
Here's an example of the data:
H5 | I5 | J5 | K5 | L5 | M5 | N5 | O5 | P5 | Q5 | R5 | S5
1 3 5 6 3
I want to get Excel to return the address K5, as that is the first
cell, from left to right, in the range H5:S5, that has data in it.
Hopefully this is more clear.
Thanks,
Dave
> I don't think you understand my question. The first cell in that
> range that has a value in it is K5. I want to know how to return that
[quoted text clipped - 29 lines]
>
> - Show quoted text -
Dave F - 19 Mar 2008 18:51 GMT
> Let me try to make this more concrete.
>
[quoted text clipped - 50 lines]
>
> - Show quoted text -
OK, I answered this question on my own...something like
=CELL("address",OFFSET(I5,,(MATCH(1,--(I5:T5>0),0)-1))) entered as an
array returns the cell address.
Thanks,
Dave
Ron Rosenfeld - 19 Mar 2008 18:52 GMT
>Given the range H5:S5, how can I have Excel return the cell address of
>the first value that appears in that range.
[quoted text clipped - 5 lines]
>
>Dave
=ADDRESS(ROW(H5:S5),COLUMN(H5:S5)-1+MATCH(TRUE,len(H5:S5)>0,0))
entered as an **array** formula.
It could be simplified to:
=ADDRESS(ROW(H5),COLUMN(H5)-1+MATCH(TRUE,len(H5:S5)>0,0))
or even:
=ADDRESS(5,7+MATCH(TRUE,len(H5:S5)>0,0))
depending on your specific requirements.
--ron