Selecting a Value from a Range of Values

G

Guest

I want to select a value from a range of 20 Values depending upon the relationship between two cells outside that range.

Lets say the Range of Values I want to select from is held in A1 to A20

I then Have a Range of Different Values in held in C1 to C24 - C1 = 1, C2 =2 ..... C24 = 24

In E1 I have a Value that could be anything from 1 to 24


If C1 = E1, I want to put the Value in A1 into D1, A2 into D2, A3 into D3 etc
If C2 = E1, I want to put 0 into D1,the Value in A1 into D2, A2 into D3, A3 into D4 etc

Can it be done?
 
R

RagDyeR

Simplest way would be with one formula in D1,
And another in D2, which would be copied down the rest of the column.

In D1:
=IF(C1=E1,A1,IF(C2=E1,0,""))

In D2:
=IF($C$1=$E$1,A2,IF($C$2=$E$1,A1,""))
And drag down to copy as needed.
--

HTH,

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

I want to select a value from a range of 20 Values depending upon the
relationship between two cells outside that range.

Lets say the Range of Values I want to select from is held in A1 to A20

I then Have a Range of Different Values in held in C1 to C24 - C1 = 1, C2 =2
...... C24 = 24

In E1 I have a Value that could be anything from 1 to 24


If C1 = E1, I want to put the Value in A1 into D1, A2 into D2, A3 into D3
etc
If C2 = E1, I want to put 0 into D1,the Value in A1 into D2, A2 into D3, A3
into D4 etc

Can it be done?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top