Searching for answer involving drop down box..

Bravo2003

Active Member
Joined
Apr 1, 2010
Messages
278
Office Version
  1. 365
Platform
  1. Windows
OK, think this one may take some resolving...


Sheet 3 Column F needs to have a formula that will:
  1. Look in cell E2 (drop down cell choice A, B or C)
  2. Also look at Cell in column D (same row as F) for unique item code
  3. Look in sheet 2, find matching item code in column D (same column sheet 2 & 3)
  4. Then dependent on A, B or C in cell E2
    1. return answer from A=Column G, B=Column M and C=Column T
For test purposes lets work on ROW 4 to start

So Sheet 3 has - Cell D4 = 01237, & E2 = B need answer in F4
Sheet 2 has - Cell D4 = 01237, G4 = 69.06, M4 = 35.49 & T4 = 33.12

If it helps Unique Item code appears line up in both sheets i.e: D4 is same item, D5 is next item, etc...

Anyone able to offer a solution?

Thanks in advance.

Regards

Bravo
 
Last edited:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Code:
=INDIRECT("Sheet2!"&CHOOSE(CODE($E$2)+1-CODE("A"),"G","M","T")&ROW(D4))

1. The CHOOSE converts A/B/C into 1/2/3 using CODE($E$2)+1-CODE("A") -- CODE returns the ASCII value of a character.

2. Using the 1/2/3 it chooses "G", "M" or "T", then the row number of D4 is added on, forming "G4", "M4" or "T4".

3. Since the numbers are on Sheet2 it prefixes the above with "Sheet2!", forming "Sheet2!G4", "Sheet2!M4" or "Sheet2!T4".

4. Finally, INDIRECT translates that string into a formula, yielding your result. Note: no initial equal-sign (=).
 
Upvote 0
Code:
=INDIRECT("Sheet2!"&CHOOSE(CODE($E$2)+1-CODE("A"),"G","M","T")&ROW(D4))

1. The CHOOSE converts A/B/C into 1/2/3 using CODE($E$2)+1-CODE("A") -- CODE returns the ASCII value of a character.

2. Using the 1/2/3 it chooses "G", "M" or "T", then the row number of D4 is added on, forming "G4", "M4" or "T4".

3. Since the numbers are on Sheet2 it prefixes the above with "Sheet2!", forming "Sheet2!G4", "Sheet2!M4" or "Sheet2!T4".

4. Finally, INDIRECT translates that string into a formula, yielding your result. Note: no initial equal-sign (=).

Thats perfect, but I need to rename sheet2 to be 'CTF Spreadsheet', but when I change it it's messing the formula up?

What do I need to do?
 
Upvote 0
Put the sheet name in single quotes:
Code:
=INDIRECT("'CTF Spreadsheet'!"&CHOOSE(CODE($E$2)+1-CODE("A"),"G","M","T")&ROW(D4))
 
Upvote 0

Forum statistics

Threads
1,224,560
Messages
6,179,520
Members
452,922
Latest member
nstaab07

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top