mattbro456
New Member
- Joined
- Nov 21, 2014
- Messages
- 5
I'm having trouble with a sales database I'm currently working on, the point of this database is too keep track of all the varying sales department and noting how many units and money was made in each year.
On one spreadsheet I have about 49 tables created for each department each one looks like the example below but will have different department names (Software, Hardware, etc.) and they are all on one sheet, looking like the example:
Sheet Name: Departments (1)
[TABLE="width: 500"]
<tbody>[TR]
[TD]Software Dpt[/TD]
[TD]2010[/TD]
[TD]2011[/TD]
[TD]2012[/TD]
[TD]2013[/TD]
[TD]2014[/TD]
[/TR]
[TR]
[TD]units[/TD]
[TD]200[/TD]
[TD]220[/TD]
[TD]240[/TD]
[TD]180[/TD]
[TD]215[/TD]
[/TR]
[TR]
[TD]Price[/TD]
[TD]$15[/TD]
[TD]$10[/TD]
[TD]$17[/TD]
[TD]$19[/TD]
[TD]$20[/TD]
[/TR]
[TR]
[TD]Revenue[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 500"]
<tbody>[TR]
[TD]Hardware Dpt[/TD]
[TD]2010[/TD]
[TD]2011[/TD]
[TD]2012[/TD]
[TD]2013[/TD]
[TD]2014[/TD]
[/TR]
[TR]
[TD]units[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[/TR]
[TR]
[TD]Price[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[TD]xxx[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[/TR]
[TR]
[TD]Revenue[/TD]
[TD]xx[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]xx[/TD]
[/TR]
</tbody>[/TABLE]
What I would like to do is this: on a separate sheet I have a data validated cell that has all the departments listed so I can just click and select a specific department. After I select a department (like Software) I would like it to auto fill itself by essentially dragging the column data from the first sheet into the table so it looks like the following table.
Sheet name: Lookback (2)
Department: Software (this is B2 in the provided function I tried)
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]2010[/TD]
[TD]2011[/TD]
[TD]2012[/TD]
[TD]2013[/TD]
[TD]2014[/TD]
[/TR]
[TR]
[TD]units[/TD]
[TD]200[/TD]
[TD]220[/TD]
[TD]240[/TD]
[TD]180[/TD]
[TD]215[/TD]
[/TR]
[TR]
[TD]Price[/TD]
[TD]$15[/TD]
[TD]$10[/TD]
[TD]$17[/TD]
[TD]$19[/TD]
[TD]$20[/TD]
[/TR]
[TR]
[TD]Revenue[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[/TR]
</tbody>[/TABLE]
The current function I have typed out is {=IFERROR(INDEX(Departments!$A$1:$A$9,SMALL(IF(Department!$A$1:A$9=B$2,COLUMN(Departments!$B1:B9)-COLUMN(Departments!B1)+1),COLUMNS(DepartmentsB1:B2))),"")}
This formula will match the correct data for some selected departments, but it's not consistent for all.
Thoughts?
On one spreadsheet I have about 49 tables created for each department each one looks like the example below but will have different department names (Software, Hardware, etc.) and they are all on one sheet, looking like the example:
Sheet Name: Departments (1)
[TABLE="width: 500"]
<tbody>[TR]
[TD]Software Dpt[/TD]
[TD]2010[/TD]
[TD]2011[/TD]
[TD]2012[/TD]
[TD]2013[/TD]
[TD]2014[/TD]
[/TR]
[TR]
[TD]units[/TD]
[TD]200[/TD]
[TD]220[/TD]
[TD]240[/TD]
[TD]180[/TD]
[TD]215[/TD]
[/TR]
[TR]
[TD]Price[/TD]
[TD]$15[/TD]
[TD]$10[/TD]
[TD]$17[/TD]
[TD]$19[/TD]
[TD]$20[/TD]
[/TR]
[TR]
[TD]Revenue[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 500"]
<tbody>[TR]
[TD]Hardware Dpt[/TD]
[TD]2010[/TD]
[TD]2011[/TD]
[TD]2012[/TD]
[TD]2013[/TD]
[TD]2014[/TD]
[/TR]
[TR]
[TD]units[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[/TR]
[TR]
[TD]Price[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[TD]xxx[/TD]
[TD]xx[/TD]
[TD]xx[/TD]
[/TR]
[TR]
[TD]Revenue[/TD]
[TD]xx[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]xx[/TD]
[/TR]
</tbody>[/TABLE]
What I would like to do is this: on a separate sheet I have a data validated cell that has all the departments listed so I can just click and select a specific department. After I select a department (like Software) I would like it to auto fill itself by essentially dragging the column data from the first sheet into the table so it looks like the following table.
Sheet name: Lookback (2)
Department: Software (this is B2 in the provided function I tried)
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]2010[/TD]
[TD]2011[/TD]
[TD]2012[/TD]
[TD]2013[/TD]
[TD]2014[/TD]
[/TR]
[TR]
[TD]units[/TD]
[TD]200[/TD]
[TD]220[/TD]
[TD]240[/TD]
[TD]180[/TD]
[TD]215[/TD]
[/TR]
[TR]
[TD]Price[/TD]
[TD]$15[/TD]
[TD]$10[/TD]
[TD]$17[/TD]
[TD]$19[/TD]
[TD]$20[/TD]
[/TR]
[TR]
[TD]Revenue[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[TD]$$$[/TD]
[/TR]
</tbody>[/TABLE]
The current function I have typed out is {=IFERROR(INDEX(Departments!$A$1:$A$9,SMALL(IF(Department!$A$1:A$9=B$2,COLUMN(Departments!$B1:B9)-COLUMN(Departments!B1)+1),COLUMNS(DepartmentsB1:B2))),"")}
This formula will match the correct data for some selected departments, but it's not consistent for all.
Thoughts?