Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
197 views
in Technique[技术] by (71.8m points)

How can I use offset function in Excel by adding just the number of column?

This is the sample: enter image description here

if I add the number for the column must get the content of the column in the get_info column As you see by entering 2 get 4 in column get_info, entered 5 get 1 and so on


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You could use INDEX and MATCH:

For Row 2: =MATCH(B2,$C$1:$F$1) would lookup the index of the column your value is in. The $ around the range value in C1:F1 will ensure the column headers are static even if you copy the formula down.

Then combine with index: =INDEX(C2:F2,1,MATCH(B2,$c$1:$F$1)) which retrieves the data from that index.

A nice extra is you could wrap that in =IFNA(formula' "") which will prevent it showing #N/A if you haven't entered a value into a cell in column B.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...