Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2

Status
Not open for further replies.

ashtonp2

MIS
Jan 21, 2004
27
GB
Hi

Can anyone advise me how I can write a formula which makes a cell equal to a1 if the contents of another cell A1 in another sheet equals 1 and b2 if the contents of the same cell equals 2. I need to be able to drag the formula down so on the next row the formula then equals a3 or b3 etc based on the same cell lookup.

Hope this makes sense (suspect not )

Paul
 
Ps I should have said I have tired to do this with an if statement but the problem is that I actully need to do this for 12 columns and the formula is too long with 12 if statments
 
Hi,

Well it might be a good idea is you state the ENTIRE problem.

Are these 12 contiguous columns? If so
[tt]
=VLOOKUP(A1,Sheet2!$a$1:$I:1,2,false)
[/tt]
returns the value from sheet2 row1 column B (2)

Skip,

[glasses] [red]Be advised:[/red] Researchers have found another Descartes trueism, "Cogito ergo spud."
"I think; therefore, I YAM!
[tongue]
 
Hi
The formula I started to write is

=IF('Lookup tables'!$C$51=1,T2,IF('Lookup tables'!$C$51=2,U2,IF('Lookup tables'!$C$51=3,V2,IF('Lookup tables'!$C$51=4,W2,IF('Lookup tables'!$C$51=5,X2,IF('Lookup tables'!$C$51=6,Y2,IF('Lookup tables'!$C$51=7,Z2,IF('Lookup tables'!$C$51=8,AA2,0))))))))

I need to be able to drag the formula down but as there is a limit to the size of the formula I can not make it long enough. Basically I have 12 months of data in 12 columns i want to make column 13 equal to a particular column depending on what people select from a drop down menue i.e. it would equal column 1 if they they select January, however i need to be able to drag the formula down so column 13 row 1 is a1 if jan and row 2 is a2 if jan and so on
 
The take a look at the OFFSET formula.

The entered values, 1, 2, 3, etc would be the COLUMN OFFSET (argument 3)
[tt]
=OFFSET('Lookup tables'!$A$2,ROW()-2,$F$1-1,1,1)
[/tt]
where $F$1 is where the 1, 2, 3 selection is.

Copy this formula down

Skip,

[glasses] [red]Be advised:[/red] Researchers have found another Descartes trueism, "Cogito ergo spud."
"I think; therefore, I YAM!
[tongue]
 
If you have less than 29 options you can use choose.

=CHOOSE(a1,B1,c1,d1,e1,f1)

Jim

 
Thanks Skip and Jim both formulas worked great.
Again thanks this really helped
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top