Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Automatically update ProjectSummary workbook, from last row of multiple projects workbooks

Posted on 2016-10-30
8
Medium Priority
?
69 Views
Last Modified: 2016-11-01
Hello Experts,

I had a similar question answered, so very much appreciated as the script was 1st class :) This is a variation, so any help would again be greatly appreciated.

I've got ProjectSsummary.xlsx

A				B												C
Project Name	Full pathname									Summary
Project1			C:\Users\Jamie\CCCWork\[Project1.xlsx]Sheet1		Update1-3    	
Project2			C:\Users\Jamie\CCCWork\[Project2.xlsx]Sheet1		Update2-3    	
Project3			C:\Users\Jamie\CCCWork\[Project3.xlsx]Sheet1		Update3-3    	

For the Summary (C) fields;

=OFFSET('C:\Users\Jamie\CCCWork\[Project1.xlsx]Sheet1'!A1,COUNTA('C:\Users\Jamie\CCCWork\[Project1.xlsx]Sheet1'!$A:$A)-1,0)

Which is just the first column, whereas, I want all the columns (2 in this case) to be displayed - so I changed to

=OFFSET('C:\Users\Jamie\CCCWork\[Project1.xlsx]Sheet1'!A1,COUNTA('C:\Users\Jamie\CCCWork\[Project1.xlsx]Sheet1'!$A:$A)-1,0,1,2)

But this doesn't work - plus all the spreadsheets have to be opened for this work?

Finally, I've hard-coded the full path names, but I want to be able to use those from Col B
   
Sample data project workbooks

[b]Project1. xls[/b]
A                       B
Update1-1      01/01/2016
Update1-2      01/02/2016
Update1-3      01/03/2016

[b]Project2. xls[/b]
A                      B
Update2-1      02/01/2016
Update2-2      02/02/2016
Update2-3      02/03/2016

[b]Project3. xls[/b]
A                      B
Update3-1      03/01/2016
Update3-2      03/02/2016
Update3-3      03/03/2016

Open in new window


Many thanks

Jamie
0
Comment
Question by:Jamie
  • 3
  • 3
  • 2
8 Comments
 
LVL 2

Accepted Solution

by:
Jimy earned 1000 total points
ID: 41866128
Hi Jamie,

unfortenately files you refered must be opened.
VBA solution explained:
(http://stackoverflow.com/questions/21072781/use-file-path-from-a-predefined-cell-in-a-formula)

To use file address from cell:

=OFFSET(INDIRECT("'"&B2&"'!"&CELL("address";$A$1));COUNTA(INDIRECT("'"&B2&"'!"&"$A:$A"))-1;0)

When OFFSET returns more than one cell you can use SUM function, but you can't concatenate text from array.
Therefore you can add another column "D" for Summary for column B from source

=TEXT(OFFSET(INDIRECT("'"&B2&"'!"&CELL("address";$A$1));COUNTA(INDIRECT("'"&B2&"'!"&"$A:$A"))-1;1);"MM/DD/YYYY")


or concatenate both returned data within C- Summary column:

=OFFSET(INDIRECT("'"&B2&"'!"&CELL("address";$A$1));COUNTA(INDIRECT("'"&B2&"'!"&"$A:$A"))-1;0) & " " & TEXT(OFFSET(INDIRECT("'"&B2&"'!"&CELL("address";$A$1));COUNTA(INDIRECT("'"&B2&"'!"&"$A:$A"))-1;1);"MM/DD/YYYY")

Regards,
Jimy
0
 
LVL 13

Assisted Solution

by:ioane
ioane earned 1000 total points
ID: 41866646
Hi Jamie,

I would normally use an index/match function for this to ensure always getting the latest update version regardless of data order.

E.g.
Get latest update date (COLUMN D):
=MAX(INDIRECT("'" & $B2 & "'!$B:$B"))

Then use Index/match to get version number of latest update (COLUMN C:):
=INDEX(INDIRECT("'" & $B2 & "'!$A:$A"),MATCH($D2,INDIRECT("'" & $B2 & "'!$B:$B"),0))

This is a simpler and (IMHO) more robust solution.
0
 

Author Comment

by:Jamie
ID: 41867927
Hi Jimy & ioane,

Many thanks for both your help and solutions - for some reason, I cannot get either to work - clearly I'm doing something wrong?

Regards

Jamie
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:ioane
ID: 41867948
Hi Jamie,

Can you upload an example of your work so we can see where you may have gone wrong?

ioane.
0
 

Author Comment

by:Jamie
ID: 41867954
Hi ioane,

Apologies, my error - I've got it working now, I need to open my eyes fully in the morning!

In regard to your solution, it displays col A (from e.g. Project1.xlxs) in ProjectSummary.xlxs, whereas, I want col A to col xx displayed - is this possible?

Also, as Jimy says above - all referenced workbooks need to be open for it to work - is there no way around this, e.g. with vb?

Regards

Jamie
0
 
LVL 2

Expert Comment

by:Jimy
ID: 41867957
Hi Jamie,

Example for vba solution to open workbooks is attached in my first response, and sure, if you go with vba you can do whatewer you like regarding data from source files.

To get more than one column from the source, you must define it in your 'summary file' cell(s), as I did in first comment.

Regards,
Jimy
0
 
LVL 13

Expert Comment

by:ioane
ID: 41867963
Hi Jamie,

This is possible but more complex. Will be easier if you can post an example spreadsheet(s) to work on.

Anything's possible with VBA, but again need more info/example showing how your spreadsheets are put together.

Cheers,
ioane.
1
 

Author Closing Comment

by:Jamie
ID: 41869608
Hi Jimy, ioane,

Both your solutions work well, which is great news :) Your help and suggestions also provide me with the guidance I need to tweak the solutions further. Many thanks, much appreciated.

Regards

Jamie
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question