Ok.....keeping with the "theme" of automation (or, as much of it as
possible)
Option 1 - the "Dump" of data will contain both Store numbers and Project
numbers in the same column.
(ie - Store 2885 and Project 408465 are for the same thing).
Option 2 would lead to extra work and having multiple data sources really
complicates things. So, option 1 it is!
Something I don't understand is how you know a project # and a store # are
related. I guess that would be called "local knowledge"!
Let's assume the store/proj numbers look like this at this time:
408465
2095
408465
*YOU* know that 408465 is a project number and 2095 is a store number but to
Excel they're equal in that they're just numbers. At a later time project
408465 is completed and now becomes store number 2885. So, now the list
might look like this:
408465
2095
408465
2885
2885
We need to come up with some method to determine when a project graduates
into a store so we can extract both categories of data. I assume you
have/want a sheet for project 408465 data and when 408465 graduates into
2885 to also extract that data.
So.............
Here's what I came up with..........
You create the project sheet and name it 408465. When 408465 graduates into
store number 2885 you then rename the sheet like this: 2885-408465.
To extract all the data for both the project and the store:
On sheet 408465:
A1 = header = Store #
A2 = header = Project #
A3 = header = Total Records
B1 = formula = will return the store # from the sheet name tab
=IF(ISERROR(FIND("-",MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255))),"",--LEFT(MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255),FIND("-",MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255))-1))
B2 = formula = will return the project # from the sheet name tab
=IF(ISERROR(FIND("-",MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255))),--MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255),--MID(MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255),FIND("-",MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255))+1,255))
B3 = formula = will return the total number of records
=SUMPRODUCT(COUNTIF(Dump!A:A,B1:B2))
When the status is still in the project phase and the sheet name is just the
project number only that value will appear in cells B1 and B2: Sheet name =
408465
..............A......................B
1......Store #....................
2......Project #............408465
When the project graduates into a store and you rename the sheet:
2885-408465, then the store number will appear in B1:
..............A......................B
1......Store #................2885
2......Project #.............408465
Note: I'm assuming that both project numbers and store numbers will only
contain numeric digits. That's how I wrote the formulas to extract from the
sheet name.
Now, the formula to extract the data:
A5:C5 = headers = Account #, Date, Amount
Array entered formula in A6:
=IF(ROWS($1:1)<=$B$3,INDEX(Dump!B$2:B$10,SMALL(IF(ISNUMBER(MATCH(Dump!$A$2:$A$10,$B$1:$B$2,0)),ROW(Dump!B$2:B$10)-ROW(Dump!B$2)+1),ROWS($1:1))),"")
Copy across to C6 then down (as before). You'll have to reformat B6:Bn as
DATE.
Biff
HI Biff,
This actually can be done one of two ways - what ever is easier for you :
Option 1 - the "Dump" of data will contain both Store numbers and Project
numbers in the same column.
(ie - Store 2885 and Project 408465 are for the same thing).
Or
Option 2 - I can arrange it so that there are two "dumps" of data - one
for
the store information, and one for the project information.
Whatever makes it easier.
Let me know your thoughts.
Thanks!
Rob