Return the Cell address based on a value

ds_robb

Board Regular
Joined
Aug 25, 2002
Messages
73
Hi,

Can you advise how I can check a cell address based on a number contained within it. So what I have (Let's say in A1 going across to J1) are the numbers 1 through 10, so A1 = 1, B1=2, C1=3 etc up to 10. On the line below, all the cells are blank, apart from one which will contain a "1". I need a formula that would show me which cell the 1 resides in so I can say OK that's in cell C2 (under C1) which I know is a 3. Therefore the item on this line is at stage 3 of a lifecycle. I hope that makes sense.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
How about:

varios 09abr2020.xlsm
ABCDEFGHIJK
112345678910
213
Hoja2
Cell Formulas
RangeFormula
K2K2=INDEX(A1:J1,0,MATCH(1,A2:J2,0))
 
Upvote 0
On the line below, all the cells are blank, apart from one which will contain a "1".
If that is the case then you could also use this column K formula.
And if the headers really are 1 to 10 then you could just use column L formula.

20 04 10.xlsm
ABCDEFGHIJKL
112345678910
2133
3166
ds_robb
Cell Formulas
RangeFormula
K2:K3K2=LOOKUP(1,A2:J2,A$1:J$1)
L2:L3L2=MATCH(1,A2:J2)
 
Upvote 0
Can I add one more thing to this So assuming column A now has an ID Code. But the codes are not sequential, I want to be able to first look up where ID 3 sits and then find where on that particular row the number 1 sits. So I presume I need a version of VLOOKUP which first searches for the ID 3 and then the match to find the column on that row with a 1 in. I'm trying to compare two tables to show where the status (1-10) has moved week to week, but the issue is the ID's are not always sequential, so row 3 in the spreadsheet example below week 1 has a ID 3..... week 2 could be a different ID in here and 3 is sitting elsewhere, say row 5.... so I need to locate it to compare it.

I hope that makes sense


ID12345678910
21
31
 
Upvote 0
Try either of these

20 04 10.xlsm
ABCDEFGHIJKLMNO
1ID12345678910IDHdrHdr
221355
341233
431
581
ds_robb (2)
Cell Formulas
RangeFormula
N2:N3N2=LOOKUP(1,INDEX(B$2:K$5,MATCH(M2,A$2:A$5,0),0),B$1:K$1)
O2:O3O2=INDEX(B$1:K$1,MATCH(1,INDEX(B$2:K$5,MATCH(M2,A$2:A$5,0),0)))
 
Upvote 0
Try either of these

20 04 10.xlsm
ABCDEFGHIJKLMNO
1ID12345678910IDHdrHdr
221355
341233
431
581
ds_robb (2)
Cell Formulas
RangeFormula
N2:N3N2=LOOKUP(1,INDEX(B$2:K$5,MATCH(M2,A$2:A$5,0),0),B$1:K$1)
O2:O3O2=INDEX(B$1:K$1,MATCH(1,INDEX(B$2:K$5,MATCH(M2,A$2:A$5,0),0)))

Thank you Peter, that worked perfectly, much appreciated.
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,453
Members
448,967
Latest member
grijken

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top