Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

display value from another cell selected on the basis of variables in a drop-down menu

I'm producing a spreadsheet to help me assess the financial viability of hiring employees for my business based on their qualifications and the number of days they work.


On a sheet called 'employees' I have separate tables for each kind of employee based on qualifications (e.g. 1st year apprentice, 2nd year apprentice, 3rd year apprentice, 4th year apprentice, Tradesperson). In each of these tables I have rows itemising expenses and columns for number of days per week worked (1, 2, 3, 4 and 5). The final row (29) gives me a total of the expenses. So cell D29 of each table gives me the expense for each employee on a 1 day per week basis, E29 gives me the expense on a 2 day per week basis, E30 3 days per week, E31 4 days, and E32 5 days.


Now on my first sheet called 'Variables' I want to pull the relevant data from the employee tables based on the variables I select. I have a table (Table 1) with a number of rows that can each represent an employee. The cells in column A contain a drop down menu allowing me to choose the kind of employee (e.g. 1st year apprentice, 2nd year apprentice...) Column B has a drop down menu that allows me to choose the number of days per week (e.g. 1, 2...) Now I want column C to display the relvant value from one of the employee tables.


If (in Table 1) I choose '1st year apprentice' in A4 and '5' (days per week) in B4 I want C4 to display the value from the cell E32 from the table '1st year apprentice'. And if I choose 'Tradesperson' in A5 and and '3' in B5 I want C5 to display the value from the cell E30 from the table 'Tradesperson'.


Is there a formula that can do this sort of thing or am I trying to get numbers to do something it isn't designed to do?


Thanks,


Ben.

iMac (27-inch Mid 2011), OS X Mavericks (10.9)

Posted on May 24, 2015 8:14 PM

Reply
4 replies

May 26, 2015 5:48 AM in response to SGIII

Thanks for replying SG.


The screenshots below were taken on my iPad from the spreadsheet I've been preparing on my Mac.

User uploaded file

User uploaded file

The first screenshot shows two of the employee tables (1st year apprentice and 2nd year apprentice). The second screenshot shows Table 1 in the variables page.

In this example I have chosen 1st year apprentice in A5 at 5 days per week in B5 and I'd like the spreadsheet to show the content of H29 from the 1st year apprentice table. I have also chosen 2nd year apprentice in A6 and 2 days per week in B6. I would like C5 to automatically work out to show the content of E29 from the 2nd year apprentice table.


Ben.

May 26, 2015 8:15 AM in response to hunterclan

If I understand you correctly, you could try something like this:


User uploaded file




A5 and B5 are dropdown. C6 contains a formula like this:


=INDEX(INDIRECT(A5&"::"&"A:H"),29,MATCH(B5,INDIRECT(A5&"::"&"1:1"),0))


The INDIRECT constructs a reference to the table named in A5. The INDEX MATCH combination looks up the value.


Note: Avoid any merged cells! They're trouble.


Another note: You could consider defining your Total row as a Footer Row. That way something like SUM(H3:H28) can be simply =SUM(H)



SG

May 31, 2015 3:15 AM in response to SGIII

Thanks so much SG.


I couldn't get the focmula you posted work exactly but looking at your syntax helped me understand some of what you were doing and I adapted the formula to work just using the INDIRECT function.


I added a table called "Calc" and into column "A" I entered the letters D, E, F, G and H into rows 1, 2, 3, 4 and 5. Then I was ble to make the formula look like this:


INDIRECT(A5&"::"&INDIRECT("Calc::A"&B5)&"29")


I'm sure your formula didn't need the extra table but It took me long enough to work this out and it works. Also thank you for the other tips. I'll avoid merged cells and start using footer rows!


Ben

display value from another cell selected on the basis of variables in a drop-down menu

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.