Return Contents of Cell Based on Column Number

ellison

Active Member
Joined
Aug 1, 2012
Messages
356
Office Version
  1. 365
Platform
  1. Windows
Hi, we are trying to duplicate the contents of a cell (from the same row) based on the column number which has been chosen.

i.e. the raw data in Columns D to H has been reviewed, and the "Chosen Column" to use has been put in Col C.

And somehow we would like our "Goal" in Col B to duplicate the contents of the cell which has been selected.

Return-Cell-Contents-Based-On-Column-Number-01.xlsx
ABCDEFGH
1Row NumberGoalChosen Column From D to HDEFGH
22I1Iwill not bechosen
33993sometimesnumbers99
44Case4UpperAndLOWERCase
55blanks5thereareblanks
66goal1goal
Sheet1
Cell Formulas
RangeFormula
A2:A6A2=ROW()


I got myself totally lost trying to look at offsets, matches and indexes

Please could somebody take a look?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
try
=CHOOSECOLS(D2:H2,C2)

Book5
ABCDEFGHIJ
1Row NumberGoalChosen Column From D to HDEFGH
22I1Iwill not bechosenI
33993sometimesnumbers9999
44Case4UpperAndLOWERCaseCase
55blanks5thereareblanksblanks
66goal1goalgoal
Sheet1
Cell Formulas
RangeFormula
A2:A6A2=ROW()
B2:B6B2=CHOOSECOLS(D2:H2,C2)
J2:J6J2=CHOOSECOLS(D2:H2,C2)
 
Upvote 0
Solution
Another option
Excel Formula:
=INDEX(D2:H2,,C2)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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