ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count Columns, Return Content (https://www.excelbanter.com/excel-worksheet-functions/237584-count-columns-return-content.html)

Leah G

Count Columns, Return Content
 
I need a function to return the contents of a cell based on a number given in
column F. Here it is:

A B C D E F
* $ @ % # 3 (I would need column G to return @ since it's 3
columns over)
^ ! % # * 2 (I would need column G to return ! since it's 2
columns over)

Does this make sense?


Mike H

Count Columns, Return Content
 
Try this in g1

=CHOOSE(F1,A1,B1,C1,D1,E1)

Mike

"Leah G" wrote:

I need a function to return the contents of a cell based on a number given in
column F. Here it is:

A B C D E F
* $ @ % # 3 (I would need column G to return @ since it's 3
columns over)
^ ! % # * 2 (I would need column G to return ! since it's 2
columns over)

Does this make sense?


Alan McQuaid via OfficeKB.com

Count Columns, Return Content
 
Hi Leah,

You could use OFFSET for this

Enter
=OFFSET(A1,0,F1-1,1,1)
in column G

Remember that A1 and F1 in this formula will need to be changed to the
corresponding cells you are working on

Alan

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200907/1


RagDyeR

Count Columns, Return Content
 
Try this:

=INDEX(A1:E1,F1)

Copy down as needed.
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===


"Leah G" <Leah wrote in message
...
I need a function to return the contents of a cell based on a number given
in
column F. Here it is:

A B C D E F
* $ @ % # 3 (I would need column G to return @ since it's 3
columns over)
^ ! % # * 2 (I would need column G to return ! since it's 2
columns over)

Does this make sense?



Leah G[_2_]

Count Columns, Return Content
 
That didn't work. Should there be a : somewhere?

"Mike H" wrote:

Try this in g1

=CHOOSE(F1,A1,B1,C1,D1,E1)

Mike

"Leah G" wrote:

I need a function to return the contents of a cell based on a number given in
column F. Here it is:

A B C D E F
* $ @ % # 3 (I would need column G to return @ since it's 3
columns over)
^ ! % # * 2 (I would need column G to return ! since it's 2
columns over)

Does this make sense?


Leah G[_2_]

Count Columns, Return Content
 
This worked! Thanks so much!

"Alan McQuaid via OfficeKB.com" wrote:

Hi Leah,

You could use OFFSET for this

Enter
=OFFSET(A1,0,F1-1,1,1)
in column G

Remember that A1 and F1 in this formula will need to be changed to the
corresponding cells you are working on

Alan

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200907/1



Mike H

Count Columns, Return Content
 

That didn't work. Should there be a : somewhere?


It works perfectly and no there shouldn't be a : somewhere

Mike

"Leah G" wrote:

That didn't work. Should there be a : somewhere?

"Mike H" wrote:

Try this in g1

=CHOOSE(F1,A1,B1,C1,D1,E1)

Mike

"Leah G" wrote:

I need a function to return the contents of a cell based on a number given in
column F. Here it is:

A B C D E F
* $ @ % # 3 (I would need column G to return @ since it's 3
columns over)
^ ! % # * 2 (I would need column G to return ! since it's 2
columns over)

Does this make sense?



All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com