need a formula

A

Aaargh

I'm trying to set up a formula that will check the value of a cell, then
based on the value of that cell, will insert another value....i.e.

If C2 =1, then G2 = A3 or if C2 = 2, then G2 = A4, or if C2 = 3, then G2 = A5.

This will be across worksheets but all in the same workbook. The end
product will be a table where the user will input just a few variables and
Excel will populate the rest of the table.

Can this be done?
 
G

Gareth_Evans (InterCall EMEA)

In Cell G2 type =IF(C2=1,A3,IF(C2=2,A4,IF(C2=3,A5,IF(C2=4,A6,""))))

This should give you the values you've entered in A3, A4, A5 etc in cell G2
depending what value is in C2,

Best regards,

Gareth
 
L

Luke M

There is a debate between which is better OFFSET/INDEX, but you could also do:
=OFFSET(A2,C1)

Offset may give you more control if you want to control both row and column
destination.
 
M

Mike H

another one,

try this in g2

=CHOOSE(C2,A3,A4,A5)
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
D

David Biddulph

OFFSET needs more parameters than that, or at least a place for them.

Try =OFFSET(A2,C1,) [with the extra comma.]
 
A

Aaargh

The CHOOSE function worked well for one set when it dealt with sequential
values but didn't work for a set that has non-sequential values. The data is
also located in non-sequential cell locations. I don't know if this helps
clarify the situation. But thank you so much for the CHOOSE suggestion. At
least I got one set completed.
 
A

Aaargh

The nested IF functions worked the best... this is what I ended up with.

=IF(E2=4,Sewer!$K$4,IF(E2=99,Sewer!$K$9,IF(E2=12,Sewer!$K$7,IF(E2=5,Sewer!$K$5,IF(E2=1,Sewer!$K$2,IF(E2=6,Sewer!$K$6,IF(E2=12,Sewer!$K$7,IF(E2=17,Sewer!$K$8))))))))
 

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