Need help creating a database that will automatically update.

ava_h

New Member
Joined
Oct 29, 2010
Messages
23
I'm currently working on a database that will contain employee information. I would like to be able to update the master sheet, but have corresponding sheets for each one of our six locations. That way if I put in a new employee and assign them to LOC 1 (on the master sheet), they will automatically show up on the sheet I've named LOC 1. I know I can use the autofilter to show the specific locations and the employees at that location on the master sheet, but it would stiIll be more convenient to have corresponding sheets for each location. I've researched several sites, but most suggest macros and I end up feeling bewildered. :confused:
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hello and welcome to The Board.
Have a look at my reply to the following post:
http://www.mrexcel.com/forum/showthread.php?t=505488
There is a slight difference with your requirement as you need to filter on the worksheet name - here I would use the CELL function (make sure that you use both arguments to that function).
Same offer applies - if you have a problem with it, update this post with the column heading names and I will see if I can help.
 
Upvote 0
Thanks, I read through the posts, but I don't think I'm quite getting it. My column headers are as follows: A1 – Region, B1 – LNAME, C1 – Pref. Name, D1 - FName, E1 – Department. This list continues on through S1 - Misc. There are seven different region names that need to be filtered and they are POG, POB, POK, POR, POC, BRP, LMP. Each person has a region assigned to them and I would like to have them show up on the corresponding sheet for that region. For example, John Doe is at region POB and I would need him to show up on the worksheet named POB. This can all be in the same workbook with the master sheet. I would just like to update the information in one area so that it automatically updates on the corresponding sheet.

I appreciate the help!
 
Upvote 0
A quick question as the answer will make a difference to the formulas that I will use - which version of Excel is being used?
Let me have the answer and I will produce a step by step guide for your workbook.
 
Upvote 0
Right, here we go - it is good that you are using Excel 2007 because I can shorten the formulas by using IFERROR instead of the longer Excel 2003 version.

At first sight this may look complicated but it is not - it is just that there is a lot of descriptive text. I suggest that you Copy/Paste the formulas to prevent typing errors.

I recommend that you try this on a COPY of your workbook and not the original.
First of all, it is assumed that each row of data will have a value in Column A (Region) - this column will be used to calculate the number of rows of data.

1. No change is required to your 'Master' sheet. For this example I will assume that your Master sheet is called "Master Sheet" - you will then see that the name in the formulas has to be enclosed within single quotes because there is a space in the name.

2. Create a new worksheet and give it the name "Control Sheet". This sheet name has no significance other than it is meaningful. I use such a sheet in most of my workbooks but here we are only going to use two cells on the sheet. It is not really needed (you could change the formulas instead) but I have included it to make it easier to adapt the workbook for other uses. In Cell A1 enter the name "Key Column" and colour the cell green and make the font bold; in Cell A2 enter the value 1 and colour the cell yellow; put a border round those two cells. The only reason for the formatting here is cosmetic, making it stand out. This next bit is important. Select cell A2 and give it the name "KeyColumn" (without any spaces) - you do this by entering the name in the "Name Box" that you see above the Column A and B headings - after typing that name, make sure that you press "Enter". The reason for this will become clear when you enter the formulas - the value indicates the "key" column which in this case is Column A (the Region column).

3. The 'filtered' worksheets will use Column A as a "helper" column - this can later be hidden. Create a new worksheet and give it the name "POB". Copy the column headers from the Master sheet to worksheet POB but starting in Column B. So A1 to S1 on the Master sheet will become B1 to T1 on worksheet POB.

4. Enter the following formula in Cell A1 of worksheet POB:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)
The cell should now contain the name of the worksheet.

5. Enter the following formula in Cell A2 of worksheet POB:
=IFERROR(MATCH($A$1,OFFSET('Master Sheet'!$A$2,0,KeyColumn-1,COUNTA('Master Sheet'!$A:$A),1),0),"")

6. Enter the following formula in Cell A3 of worksheet POB:
=IFERROR(MATCH($A$1,OFFSET('Master Sheet'!$A$2,A2,KeyColumn-1,COUNTA('Master Sheet'!$A:$A)-A2,1),0)+A2,"")

7. Copy-down the formula that is in Cell A3 as far as you need to. This would normally be at least the same number of rows of data on the Master sheet.

8. Enter the following formula in Cell B2 of worksheet POB:
=IFERROR(INDEX(OFFSET('Master Sheet'!$A$2,0,0,COUNTA('Master Sheet'!$A:$A)-1,COUNTA('Master Sheet'!$1:$1)),$A2,COLUMN()-1),"")
and then copy-down this formula as far as the formulas were in Step 7. Also copy-across the formulas to Column T.

9. Now to create the other worksheets: Copy worksheet POB by holding down the Ctrl key, left mouse-clicking the TAB and dragging to the right. You will now have a new worksheet named "POB (2)" - rename this "POG" and you will see that the worksheet will now show the data for that region. It is as simple as that.

Additional information:
The formulas in Column A calculate the offset from row 2 where the required data is to be found.
The formulas in Columns B to T use Column A to locate the required columns.
You need to watch out when printing the filtered worksheets - make sure that you set the Print Area so that you do not print the rows with formulas but having no data.
If you need to filter on a different column, change the column number on the Control Sheet and rename your filter worksheets accordingly.

There is one 'issue' to be aware of:
If your Master sheet has blank cells, this will appear on the filtered worksheets as '0' (zero). This is an unfortunate feature of using INDEX across worksheets.
There are a couple of "solutions" for this. One is to apply a Custom Format to the cells to hide zeros (only works if you do not have some cells that must show zeros):
The Custom format is: General;General;
or something similar.
The other solution is to change the formula, entered in Step 8 to the following:
=IFERROR(IF(LEN(INDEX(OFFSET('Master Sheet'!$A$2,0,0,COUNTA('Master Sheet'!$A:$A)-1,COUNTA('Master Sheet'!$1:$1)),$A2,COLUMN()-1))=0,"",INDEX(OFFSET('Master Sheet'!$A$2,0,0,COUNTA('Master Sheet'!$A:$A)-1,COUNTA('Master Sheet'!$1:$1)),$A2,COLUMN()-1)),"")
Those zeros would have been returned for cells with a zero-length and this formula checks for that and returns a null-string.

Don't forget to hide Column A.
If you have any problems or questions, just update this thread.
 
Last edited:
Upvote 0
WOW! So far everything works perfectly! I used the second formula string for step 8 which better suites my needs. Thank you so very much! I will go back and study these formulas in a little more detail to gain a better understanding of how they operate, but I really appreciate all your help! An incredible amount of time saved! :biggrin: :biggrin: :biggrin: Thank you!!!!
 
Upvote 0
Thank you for the update - it is nice to know that it is working OK for you. Yes, it is always worth the effort to study the formulas to see how they work - as you do so, pay particular attention to INDEX and MATCH because those two together are a good alternative to using VLOOKUP that does have some limitations.
 
Upvote 0
I do have one question, what are the issues that prohibit the formulas from working with older versions of Excel? If I needed to send this file to someone using an older version, I assume I would have to change the formulas to keep the #name from showing up instead of the data?
 
Upvote 0
The problem will be with IFERROR that was new at Excel 2007.
Without the IFERROR in the formulas that I used you would get #N/A when the INDEX or MATCH failed (just like you would if using VLOOKUP).
The Excel 2003 'version' would need to repeat formulas twice so:
IFERROR(formula here,"")
would become:
IF(ISNA(formula here),"",formula here)
So, taking the formula in '5' (and I have not tested this change) it would become:
=IF(ISNA(MATCH($A$1,OFFSET('Master Sheet'!$A$2,0,KeyColumn-1,COUNTA('Master Sheet'!$A:$A),1),0)),"",MATCH($A$1,OFFSET('Master Sheet'!$A$2,0,KeyColumn-1,COUNTA('Master Sheet'!$A:$A),1),0))
Note that there are alternatives to ISNA, for example ISERROR.
 
Upvote 0

Forum statistics

Threads
1,214,981
Messages
6,122,565
Members
449,089
Latest member
Motoracer88

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