PinkUnicorn
New Member
- Joined
- Dec 12, 2017
- Messages
- 30
Hi, I wonder if someone can help. I need to write either a long IF formula or maybe VBA Im just not sure!
I have a spreadsheet with a number of columns and rows and I need to pick up data from a separate sheet in the workbook depending on the information in specific cells.
So in row I there are four options of entry these are MAJ, SSX, SER or VOL.
Depending on what shows in that row I need excel to my sheet called OUTCOME CODES and pick a specific cell and enter the text from that cell into the original sheet (the sheet that shows the MAJ, SSX, SER or VOL).
The cell which is selected will change depending on which column I am now filling in on the main spreadsheet
TABLES BELOW SHOWING THE DATA ON THE DIFFERENT SHEETS
[TABLE="width: 614"]
<tbody>[TR]
[TD]
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[TD]J
[/TD]
[TD]K
[/TD]
[TD]L
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]XXX
[/TD]
[TD]XXXX
[/TD]
[TD]XXX
[/TD]
[TD]XXX
[/TD]
[TD][/TD]
[TD]B1
[/TD]
[TD]B1
[/TD]
[TD]B2
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]09183
[/TD]
[TD]11407
[/TD]
[TD]AB13001
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]09802
[/TD]
[TD]U/K
[/TD]
[TD][/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]09803
[/TD]
[TD]13109
[/TD]
[TD]AC02016
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]09934
[/TD]
[TD]9994
[/TD]
[TD]AC95001
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]09935
[/TD]
[TD]9995
[/TD]
[TD]AC95002
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]08913
[/TD]
[TD]12099
[/TD]
[TD]AF15003
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD]07817
[/TD]
[TD]6300
[/TD]
[TD]AI04001
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9
[/TD]
[TD]07818
[/TD]
[TD]6301
[/TD]
[TD]AI04002
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
So, for example the formula I need in N2 (under the heading of code B1) is where I need excel to look in I2 and see if it says MAJ, SSX, SER or VOL. And then go to the Outcome Codes sheet (below). If I2 says MAJ then it would enter the text from D8 (which is the relevant information for a B1 outcome code for a MAJ type). If I2 says VOL (as it does in the example) then excel would select the text from G8
[TABLE="width: 650"]
<tbody>[TR]
[TD]
[/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Filing Code
[/TD]
[TD]Definition
[/TD]
[TD]
[/TD]
[TD]MAJ
[/TD]
[TD]SSX
[/TD]
[TD]SER
[/TD]
[TD]VOL
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]B1
[/TD]
[TD]EXAMPLE 1
[/TD]
[TD]
[/TD]
[TD]TEXT 1
[/TD]
[TD]TEXT 2
[/TD]
[TD]TEXT 3
[/TD]
[TD]TEXT 4
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]B2
[/TD]
[TD]EXAMPLE 2
[/TD]
[TD]
[/TD]
[TD]TEXT 5
[/TD]
[TD]TEXT 6
[/TD]
[TD]TEXT 7
[/TD]
[TD]TEXT 8
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]B5
[/TD]
[TD]EXAMPLE 3
[/TD]
[TD]
[/TD]
[TD]TEXT 9
[/TD]
[TD]TEXT 10
[/TD]
[TD]TEXT 11
[/TD]
[TD]TEXT 12
[/TD]
[/TR]
</tbody>[/TABLE]
I have a spreadsheet with a number of columns and rows and I need to pick up data from a separate sheet in the workbook depending on the information in specific cells.
So in row I there are four options of entry these are MAJ, SSX, SER or VOL.
Depending on what shows in that row I need excel to my sheet called OUTCOME CODES and pick a specific cell and enter the text from that cell into the original sheet (the sheet that shows the MAJ, SSX, SER or VOL).
The cell which is selected will change depending on which column I am now filling in on the main spreadsheet
TABLES BELOW SHOWING THE DATA ON THE DIFFERENT SHEETS
[TABLE="width: 614"]
<tbody>[TR]
[TD]
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[TD]J
[/TD]
[TD]K
[/TD]
[TD]L
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]XXX
[/TD]
[TD]XXXX
[/TD]
[TD]XXX
[/TD]
[TD]XXX
[/TD]
[TD][/TD]
[TD]B1
[/TD]
[TD]B1
[/TD]
[TD]B2
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]09183
[/TD]
[TD]11407
[/TD]
[TD]AB13001
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]09802
[/TD]
[TD]U/K
[/TD]
[TD][/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]09803
[/TD]
[TD]13109
[/TD]
[TD]AC02016
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]09934
[/TD]
[TD]9994
[/TD]
[TD]AC95001
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]09935
[/TD]
[TD]9995
[/TD]
[TD]AC95002
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]08913
[/TD]
[TD]12099
[/TD]
[TD]AF15003
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD]07817
[/TD]
[TD]6300
[/TD]
[TD]AI04001
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9
[/TD]
[TD]07818
[/TD]
[TD]6301
[/TD]
[TD]AI04002
[/TD]
[TD]3
[/TD]
[TD]VOL
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
So, for example the formula I need in N2 (under the heading of code B1) is where I need excel to look in I2 and see if it says MAJ, SSX, SER or VOL. And then go to the Outcome Codes sheet (below). If I2 says MAJ then it would enter the text from D8 (which is the relevant information for a B1 outcome code for a MAJ type). If I2 says VOL (as it does in the example) then excel would select the text from G8
[TABLE="width: 650"]
<tbody>[TR]
[TD]
[/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Filing Code
[/TD]
[TD]Definition
[/TD]
[TD]
[/TD]
[TD]MAJ
[/TD]
[TD]SSX
[/TD]
[TD]SER
[/TD]
[TD]VOL
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]B1
[/TD]
[TD]EXAMPLE 1
[/TD]
[TD]
[/TD]
[TD]TEXT 1
[/TD]
[TD]TEXT 2
[/TD]
[TD]TEXT 3
[/TD]
[TD]TEXT 4
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]B2
[/TD]
[TD]EXAMPLE 2
[/TD]
[TD]
[/TD]
[TD]TEXT 5
[/TD]
[TD]TEXT 6
[/TD]
[TD]TEXT 7
[/TD]
[TD]TEXT 8
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]B5
[/TD]
[TD]EXAMPLE 3
[/TD]
[TD]
[/TD]
[TD]TEXT 9
[/TD]
[TD]TEXT 10
[/TD]
[TD]TEXT 11
[/TD]
[TD]TEXT 12
[/TD]
[/TR]
</tbody>[/TABLE]