Linking to a workbook that doesn't yet exist - for use in template creating

SophieYaldwyn

New Member
Joined
Sep 13, 2022
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hi all,
I am trying to link separate workbooks-not-worksheets that are yet to be created - these would be workbooks created in the future using templates, and the destination workbook I am working in will be a master template as well. This is for a project for study and I have really hit a roadblock here and perhaps thinking I need to completely re-think the entire first workbook I have created. For full information, the study question reads:

"Create a series of Excel spreadsheets to demonstrate the skills you learned in this module.

You will need to demonstrate your ability to design a group of spreadsheets that:

  • have a link between one spreadsheet and another
  • demonstrates conditional formatting
  • use at least three functions from Excel and one formula you create
  • has at least one macro
  • uses a template you created to produce new workbooks
  • uses charts to help analyse data
You will need to provide printouts from the spreadsheets and a copy of a chart.

Example:
A friend knows you have a good understanding of Excel.

He would like you to help him with his business. He wants to keep a spreadsheet for each month’s sales. He has five sales staff and would like to record the daily sales figure. He wants to see a monthly total for each person and a daily sales total. He would also like an average daily sale, the lowest sales figure, and the highest sales figure for each day. The data should have highlighting to show figures below the daily average and figures above the average. There should be a separate worksheet that shows a commission figure for each salesperson daily. He pays each person a flat 15% of everything they sell as a commission.

He thinks a template for the above spreadsheet would help him create a new spreadsheet every month.

Then he would like a master spreadsheet that shows each person’s monthly sales figure. He would like to have an annual total for each and a grand total. He would like a chart showing each person by month and another chart that shows each person’s annual sales figure as a part of the total sales figure."

Is what I am trying to achieve something that is possible?
I have been trying to have a reference cell in the master workbook that shows the workbook-to-be-referenced file name that can then be referenced in the formulae throughout the workbook. So as the new workbooks are created, that reference cell can be edited to contain the new workbook name, which would then automatically adjust content in all the formulae throughout the workbook to create the correct path.
I keep coming up with a File Name Syntax error though when trying to reference that reference cell (I3) in creating the new formula rather than clicking on a cell in the separate workbook.
Hopefully this makes sense and someone is able to lend some expertise. I have attached all workbooks and worksheets below for reference and a screenshot of the error.
Thankyou!
Sophie

Workbook 1, sheet 1:

ProjectBSBTEC402P1.xlsm
ABCDEFGHI
1Monthly Sales Figures: Business Name
2Month2Above AverageBelow AverageHighest FigureLowest Figure
3Year2022Legend:
4Leap Year?No
5DateDayPerson 1 Person 2Person 3Person 4Person 5Average Daily Sale TotalOverall Daily Sales Total
61Tue$ 123.00$ 123.00$ 123.00
72Wed$ 798.00$ 798.00$ 798.00
83Thu$ 23,545.00$ 7,856.00$ 15,700.50$ 31,401.00
94Fri$ 987.00$ 987.00$ 987.00
105Sat$ 3,453.00$ 5,668.00$ 4,560.50$ 9,121.00
116Sun$ 3,246.00$ 3,246.00$ 3,246.00
127Mon
138Tue
149Wed
1510Thu
1611Fri
1712Sat
1813Sun
1914Mon
2015Tue
2116Wed
2217Thu
2318Fri
2419Sat
2520Sun
2621Mon
2722Tue
2823Wed
2924Thu
3025Fri
3126Sat
3227Sun
3328Mon
34 #VALUE!
35 #VALUE!
36 #VALUE!
37Monthly Total$ 28,906.00$ 16,770.00 $ 45,676.00
38Overall Daily Sale Average$ 4,235.83
MonthlySalesFigures
Cell Formulas
RangeFormula
B4B4=IF(MONTH(DATE(B3,2,29))=2,"Yes","No")
H6:H20,H25:H36H6=IFERROR(AVERAGE(C6:G6),"")
B6:B36B6=DATE($B$3,$B$2,$A6)
A34A34=IF(OR(B2=1,B2=3,B2=4,B2=5,B2=6,B2=7,B2=8,B2=9,B2=10,B2=11,B2=12,B4="Yes"), "29", "")
A35A35=IF(B2=2,"","30")
A36A36=IF(OR(B2=1,B2=3,B2=5,B2=7,B2=8,B2=10,B2=12),"31","")
C37:G37,I37C37=IF(SUM(C6:C36)=0,"",SUM(C6:C36))
I6:I36I6=IF(SUM(C6:G6)=0,"",SUM(C6:G6))
H38H38=IFERROR(AVERAGEIF(H6:H36,"<>-"),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C36:G36Cell Valuetop 1 bottom valuestextNO
C36:G36Cell Valuetop 1 valuestextNO
C36:G36Cell Valuebelow averagetextNO
C36:G36Cell Valueabove averagetextNO
C35:G35Cell Valuetop 1 bottom valuestextNO
C35:G35Cell Valuetop 1 valuestextNO
C35:G35Cell Valuebelow averagetextNO
C35:G35Cell Valueabove averagetextNO
C34:G34Cell Valuetop 1 bottom valuestextNO
C34:G34Cell Valuetop 1 valuestextNO
C34:G34Cell Valuebelow averagetextNO
C34:G34Cell Valueabove averagetextNO
C33:G33Cell Valuetop 1 bottom valuestextNO
C33:G33Cell Valuetop 1 valuestextNO
C33:G33Cell Valuebelow averagetextNO
C33:G33Cell Valueabove averagetextNO
C32:G32Cell Valuetop 1 bottom valuestextNO
C32:G32Cell Valuetop 1 valuestextNO
C32:G32Cell Valuebelow averagetextNO
C32:G32Cell Valueabove averagetextNO
C31:G31Cell Valuetop 1 bottom valuestextNO
C31:G31Cell Valuetop 1 valuestextNO
C31:G31Cell Valuebelow averagetextNO
C31:G31Cell Valueabove averagetextNO
C30:G30Cell Valuetop 1 bottom valuestextNO
C30:G30Cell Valuetop 1 valuestextNO
C30:G30Cell Valuebelow averagetextNO
C30:G30Cell Valueabove averagetextNO
C29:G29Cell Valuetop 1 bottom valuestextNO
C29:G29Cell Valuetop 1 valuestextNO
C29:G29Cell Valuebelow averagetextNO
C29:G29Cell Valueabove averagetextNO
C28:G28Cell Valuetop 1 bottom valuestextNO
C28:G28Cell Valuetop 1 valuestextNO
C28:G28Cell Valuebelow averagetextNO
C28:G28Cell Valueabove averagetextNO
C27:G27Cell Valuetop 1 bottom valuestextNO
C27:G27Cell Valuetop 1 valuestextNO
C27:G27Cell Valuebelow averagetextNO
C27:G27Cell Valueabove averagetextNO
C25:G25Cell Valuetop 1 bottom valuestextNO
C25:G25Cell Valuetop 1 valuestextNO
C25:G25Cell Valuebelow averagetextNO
C25:G25Cell Valueabove averagetextNO
C23:G23Cell Valuetop 1 bottom valuestextNO
C23:G23Cell Valuetop 1 valuestextNO
C23:G23Cell Valuebelow averagetextNO
C23:G23Cell Valueabove averagetextNO
C24:G24Cell Valuetop 1 bottom valuestextNO
C24:G24Cell Valuetop 1 valuestextNO
C24:G24Cell Valuebelow averagetextNO
C24:G24Cell Valueabove averagetextNO
C26:G26Cell Valuetop 1 bottom valuestextNO
C26:G26Cell Valuetop 1 valuestextNO
C26:G26Cell Valuebelow averagetextNO
C26:G26Cell Valueabove averagetextNO
C22:G22Cell Valuetop 1 bottom valuestextNO
C22:G22Cell Valuetop 1 valuestextNO
C22:G22Cell Valuebelow averagetextNO
C22:G22Cell Valueabove averagetextNO
C21:G21Cell Valuetop 1 bottom valuestextNO
C21:G21Cell Valuetop 1 valuestextNO
C21:G21Cell Valuebelow averagetextNO
C21:G21Cell Valueabove averagetextNO
C20:G20Cell Valuetop 1 bottom valuestextNO
C20:G20Cell Valuetop 1 valuestextNO
C20:G20Cell Valuebelow averagetextNO
C20:G20Cell Valueabove averagetextNO
C19:G19Cell Valuetop 1 bottom valuestextNO
C19:G19Cell Valuetop 1 valuestextNO
C19:G19Cell Valuebelow averagetextNO
C19:G19Cell Valueabove averagetextNO
C18:G18Cell Valuetop 1 bottom valuestextNO
C18:G18Cell Valuetop 1 valuestextNO
C18:G18Cell Valuebelow averagetextNO
C18:G18Cell Valueabove averagetextNO
C17:G17Cell Valuetop 1 bottom valuestextNO
C17:G17Cell Valuetop 1 valuestextNO
C17:G17Cell Valuebelow averagetextNO
C17:G17Cell Valueabove averagetextNO
C16:G16Cell Valuetop 1 bottom valuestextNO
C16:G16Cell Valuetop 1 valuestextNO
C16:G16Cell Valuebelow averagetextNO
C16:G16Cell Valueabove averagetextNO
C15:G15Cell Valuetop 1 bottom valuestextNO
C15:G15Cell Valuetop 1 valuestextNO
C15:G15Cell Valuebelow averagetextNO
C15:G15Cell Valueabove averagetextNO
C14:G14Cell Valuetop 1 bottom valuestextNO
C14:G14Cell Valuetop 1 valuestextNO
C14:G14Cell Valuebelow averagetextNO
C14:G14Cell Valueabove averagetextNO
C13:G13Cell Valuetop 1 bottom valuestextNO
C13:G13Cell Valuetop 1 valuestextNO
C13:G13Cell Valuebelow averagetextNO
C13:G13Cell Valueabove averagetextNO
C10:G10Cell Valuetop 1 bottom valuestextNO
C10:G10Cell Valuetop 1 valuestextNO
C10:G10Cell Valuebelow averagetextNO
C10:G10Cell Valueabove averagetextNO
C8:G8Cell Valuetop 1 bottom valuestextNO
C8:G8Cell Valuetop 1 valuestextNO
C8:G8Cell Valuebelow averagetextNO
C8:G8Cell Valueabove averagetextNO
C9:G9Cell Valuetop 1 bottom valuestextNO
C9:G9Cell Valuetop 1 valuestextNO
C9:G9Cell Valuebelow averagetextNO
C9:G9Cell Valueabove averagetextNO
C12:G12Cell Valuetop 1 bottom valuestextNO
C12:G12Cell Valuetop 1 valuestextNO
C12:G12Cell Valuebelow averagetextNO
C12:G12Cell Valueabove averagetextNO
C11:G11Cell Valuetop 1 bottom valuestextNO
C11:G11Cell Valuetop 1 valuestextNO
C11:G11Cell Valuebelow averagetextNO
C11:G11Cell Valueabove averagetextNO
C7:G7Cell Valuetop 1 bottom valuestextNO
C7:G7Cell Valuetop 1 valuestextNO
C6:G6Cell Valuetop 1 bottom valuestextNO
C6:G6Cell Valuetop 1 valuestextNO
C7:G7Cell Valuebelow averagetextNO
C7:G7Cell Valueabove averagetextNO
C6:G6Cell Valueabove averagetextNO
C6:G6Cell Valuebelow averagetextNO
A34Cellcontains an errortextNO
B34:B36Cellcontains an errortextNO
Cells with Data Validation
CellAllowCriteria
B2List1,2,3,4,5,6,7,8,9,10,11,12
B3List2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072



Workbook 1 Sheet 2:

Cell Formulas
RangeFormula
B2:B3B2=MonthlySalesFigures!B2
B4B4=IF(MONTH(DATE(B3,2,29))=2,"Yes","No")
C6:G36C6=IF(MonthlySalesFigures!C6*$G$3=0,"",MonthlySalesFigures!C6*$G$3)
C37:G37C37=IF(SUM(C6:C36)=0,"",SUM(C6:C36))
B6:B36B6=DATE($B$3,$B$2,$A6)
A34A34=IF(OR(B2=1,B2=3,B2=4,B2=5,B2=6,B2=7,B2=8,B2=9,B2=10,B2=11,B2=12,B4="Yes"), "29", "")
A35A35=IF(B2=2,"","30")
A36A36=IF(OR(B2=1,B2=3,B2=5,B2=7,B2=8,B2=10,B2=12),"31","")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A34Cellcontains an errortextNO
B34:B36Cellcontains an errortextNO
Cells with Data Validation
CellAllowCriteria
B2List1,2,3,4,5,6,7,8,9,10,11,12
B3List2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072



Workbook 2, Sheet 1 - Where I am trying to create the link using cell I3 as a reference within a cell link such as cell B5 but not manually input.

Project BSBTEC402 P21.xlsx
ABCDEFGHI
1Individual Sales Figure Totals
2Year
3File name of source workbookProjectBSBTEC402P1.xlsm
4MonthPerson 1Person 2Person 3Person 4Person 5
5January$ 28,906.00
6February
7March
8April
9May
10June
11July
12August
13September
14October
15November
16December
17Annual Total
18Annual Grand Total
Sheet1
Cell Formulas
RangeFormula
B5B5=[ProjectBSBTEC402P1.xlsm]MonthlySalesFigures!$C$37
 

Attachments

  • Screenshot (5).png
    Screenshot (5).png
    59.9 KB · Views: 19

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Here are two ways to retrieve data from a closed workbook:

Cell Formulas
RangeFormula
L6L6="power query1.xlsm"
K6K6="c:\test\"
K7K7="'C:\test\[Power Query1.xlsm]1'"
K8K8="!$N10:$O14"
K10K10=VLOOKUP(3,'C:\test\[Power Query1.xlsm]1'!$N10:$O14,2,FALSE)


VBA Code:
Public Function getval(path$, file$, sheet$, ref$)
If Right(path, 1) <> "\" Then path = path & "\"
If Dir(path & file) = "" Then
    getval = "File Not Found"
    Exit Function
End If
getval = ExecuteExcel4Macro("'" & path & "[" & file & "]" & sheet & _
"'!" & Range(ref).Range("A1").Address(, , xlR1C1))
End Function

Sub main()

[k10].Formula = "=VLOOKUP(3," & [k7] & [k8] & ",2,FALSE)"
[k11] = getval([k6], [L6], "1", "j9")

End Sub
 
Upvote 0
Here are two ways to retrieve data from a closed workbook:

Cell Formulas
RangeFormula
L6L6="power query1.xlsm"
K6K6="c:\test\"
K7K7="'C:\test\[Power Query1.xlsm]1'"
K8K8="!$N10:$O14"
K10K10=VLOOKUP(3,'C:\test\[Power Query1.xlsm]1'!$N10:$O14,2,FALSE)


VBA Code:
Public Function getval(path$, file$, sheet$, ref$)
If Right(path, 1) <> "\" Then path = path & "\"
If Dir(path & file) = "" Then
    getval = "File Not Found"
    Exit Function
End If
getval = ExecuteExcel4Macro("'" & path & "[" & file & "]" & sheet & _
"'!" & Range(ref).Range("A1").Address(, , xlR1C1))
End Function

Sub main()

[k10].Formula = "=VLOOKUP(3," & [k7] & [k8] & ",2,FALSE)"
[k11] = getval([k6], [L6], "1", "j9")

End Sub
Hi Worf,
I'm sorry I don't understand how I can use this? Does it also apply to workbooks that don't yet exist? I'm trying to understand the processes and just not understanding.
I've copied into my workbook and tried playing around and subbing in example workbook names to the file name etc but just not figuring it out.
I'm sorry!
Is it possible to explain a bit please?
Thank you,
Sophie
 
Upvote 0
worksheet formula to retrieve values from closed workbook

Maybe you will prefer a worksheet function that can be used like any other. Just pay attention on where to paste the code.

This is a dynamic solution that accepts cell values as arguments for the formula.

To insert standard module: Insert > Module

To insert class module: Insert > Class Module

Tell me if you have trouble implementing it.

ranges.xlsm
CD
5
6c:\test\1
7power query1.xlsmJ9
8sundae
9
Sheet1
Cell Formulas
RangeFormula
C6C6="c:\test\"
C7C7="power query1.xlsm"
C8C8=getval(C6,C7,D6,D7)


VBA Code:
Rem standard module

Function xlapp()
Static oapp As New Class1
Set xlapp = oapp.xlapp
End Function

Public Function getval(Path$, file$, sheet$, ref$)
If Right(Path, 1) <> "\" Then Path = Path & "\"
If Dir(Path & file) = "" Then
    getval = "File Not Found"
    Exit Function
End If
getval = xlapp.ExecuteExcel4Macro("'" & Path & "[" & file & "]" & sheet & _
"'!" & Range(ref).Range("A1").Address(, , xlR1C1))
End Function

Rem ***********************

Rem class module named Class1

Public xlapp

Private Sub Class_Initialize()
Set xlapp = CreateObject("Excel.Application")
End Sub

Private Sub Class_Terminate()
xlapp.Quit
Set xlapp = Nothing
End Sub
 
Upvote 0
worksheet formula to retrieve values from closed workbook

Maybe you will prefer a worksheet function that can be used like any other. Just pay attention on where to paste the code.

This is a dynamic solution that accepts cell values as arguments for the formula.

To insert standard module: Insert > Module

To insert class module: Insert > Class Module

Tell me if you have trouble implementing it.

ranges.xlsm
CD
5
6c:\test\1
7power query1.xlsmJ9
8sundae
9
Sheet1
Cell Formulas
RangeFormula
C6C6="c:\test\"
C7C7="power query1.xlsm"
C8C8=getval(C6,C7,D6,D7)


VBA Code:
Rem standard module

Function xlapp()
Static oapp As New Class1
Set xlapp = oapp.xlapp
End Function

Public Function getval(Path$, file$, sheet$, ref$)
If Right(Path, 1) <> "\" Then Path = Path & "\"
If Dir(Path & file) = "" Then
    getval = "File Not Found"
    Exit Function
End If
getval = xlapp.ExecuteExcel4Macro("'" & Path & "[" & file & "]" & sheet & _
"'!" & Range(ref).Range("A1").Address(, , xlR1C1))
End Function

Rem ***********************

Rem class module named Class1

Public xlapp

Private Sub Class_Initialize()
Set xlapp = CreateObject("Excel.Application")
End Sub

Private Sub Class_Terminate()
xlapp.Quit
Set xlapp = Nothing
End Sub
Hi Worf,
I'm sorry for the delayed response, I really appreciate your help a lot!
I am frustrated because I just don't yet have the understanding to be able to implement your suggestions.
I have a friend who is well versed in VBA who I am going to sit down with with your solutions and hopefully then be able to understand and implement one of them.
I will let you know.

Thank you so so much!

Regards,
Sophie
 
Upvote 0
worksheet formula to retrieve values from closed workbook

Maybe you will prefer a worksheet function that can be used like any other. Just pay attention on where to paste the code.

This is a dynamic solution that accepts cell values as arguments for the formula.

To insert standard module: Insert > Module

To insert class module: Insert > Class Module

Tell me if you have trouble implementing it.

ranges.xlsm
CD
5
6c:\test\1
7power query1.xlsmJ9
8sundae
9
Sheet1
Cell Formulas
RangeFormula
C6C6="c:\test\"
C7C7="power query1.xlsm"
C8C8=getval(C6,C7,D6,D7)


VBA Code:
Rem standard module

Function xlapp()
Static oapp As New Class1
Set xlapp = oapp.xlapp
End Function

Public Function getval(Path$, file$, sheet$, ref$)
If Right(Path, 1) <> "\" Then Path = Path & "\"
If Dir(Path & file) = "" Then
    getval = "File Not Found"
    Exit Function
End If
getval = xlapp.ExecuteExcel4Macro("'" & Path & "[" & file & "]" & sheet & _
"'!" & Range(ref).Range("A1").Address(, , xlR1C1))
End Function

Rem ***********************

Rem class module named Class1

Public xlapp

Private Sub Class_Initialize()
Set xlapp = CreateObject("Excel.Application")
End Sub

Private Sub Class_Terminate()
xlapp.Quit
Set xlapp = Nothing
End Sub
Hi again Worf,
I have been unable to organise a time with my friend to try your VBA solution.
I have been trying copious other possible avenues and thought I finally had something figured out but am now encountering another problem.
I opted to creating an instruction for file name save format in the one workbook so I could create links to the future workbooks in the master with hopes of using the 'find and replace' tool to change the years of the file names when needed - via another instruction I have yet to include in the master workbook. This is the current master that I am trying a few things with:

Project BSBTEC402 P21 to blank for template after perfecting links.xlsm
BCDEFG
3Individual Sales Figure Totals
4Year
5
6MonthPerson 1Person 2Person 3Person 4Person 5
7January$ -$ -$ -$ -$ -
8February$ -$ -$ -$ -$ -
9March$ -$ -$ -$ -$ -
10April$ -$ -$ -$ -$ -
11May$ -
12June$ -
13July$ -
14August$ -
15September$ -
16October$ -
17November#REF!
18December$ 14,000.00$ 14,000.00$ 18,000.00$ 22,000.00$ 26,000.00
19Annual Total$ 24,000.00$ 14,000.00$ 18,000.00$ 22,000.00$ 26,000.00
20Annual Grand Total$ 104,000.00
Sheet1
Cell Formulas
RangeFormula
D7D7=IF(D7='https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesJanuary2022.xlsm]MonthlySalesFigures'!$D$37=#REF!,"",'https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesJanuary2022.xlsm]MonthlySalesFigures'!$D$37)
E7E7=IF(E7='https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesJanuary2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesJanuary2022.xlsm]MonthlySalesFigures'!$E$37)
F7F7=IF(F7='https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesJanuary2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesJanuary2022.xlsm]MonthlySalesFigures'!$F$37)
G7G7=IF(G7='https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesJanuary2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesJanuary2022.xlsm]MonthlySalesFigures'!$G$37)
D8D8=IF(D8='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesFebruary2022.xlsm]MonthlySalesFigures'!$D$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesFebruary2022.xlsm]MonthlySalesFigures'!$D$37)
E8E8=IF(E8='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesFebruary2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesFebruary2022.xlsm]MonthlySalesFigures'!$E$37)
F8F8=IF(F8='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesFebruary2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesFebruary2022.xlsm]MonthlySalesFigures'!$F$37)
G8G8=IF(G8='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesFebruary2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesFebruary2022.xlsm]MonthlySalesFigures'!$G$37)
D9D9=IF(D9='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMarch2022.xlsm]MonthlySalesFigures'!$D$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMarch2022.xlsm]MonthlySalesFigures'!$D$37)
E9E9=IF(E9='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMarch2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMarch2022.xlsm]MonthlySalesFigures'!$E$37)
F9F9=IF(F9='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMarch2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMarch2022.xlsm]MonthlySalesFigures'!$F$37)
G9G9=IF(G9='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMarch2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMarch2022.xlsm]MonthlySalesFigures'!$G$37)
D10D10=IF(D10='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesApril2022.xlsm]MonthlySalesFigures'!$D$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesApril2022.xlsm]MonthlySalesFigures'!$D$37)
E10E10=IF(E10='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesApril2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesApril2022.xlsm]MonthlySalesFigures'!$E$37)
F10F10=IF(F10='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesApril2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesApril2022.xlsm]MonthlySalesFigures'!$F$37)
G10G10=IF(G10='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesApril2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesApril2022.xlsm]MonthlySalesFigures'!$G$37)
C7C7=IF(C7=[QAkitchensSalesJanuary2023.xlsm]MonthlySalesFigures!$C$37=#REF!,"",[QAkitchensSalesJanuary2023.xlsm]MonthlySalesFigures!$C$37)
C8C8=IF(C8='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesFebruary2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesFebruary2022.xlsm]MonthlySalesFigures'!$C$37)
C9C9=IF(C9='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMarch2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMarch2022.xlsm]MonthlySalesFigures'!$C$37)
C10C10=IF(C10='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesApril2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesApril2022.xlsm]MonthlySalesFigures'!$C$37)
C11C11=IF(C11='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMay2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesMay2022.xlsm]MonthlySalesFigures'!$C$37)
C12C12=IF(C12='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesJune2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesJune2022.xlsm]MonthlySalesFigures'!$C$37)
C13C13=IF(C13='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesJuly2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesJuly2022.xlsm]MonthlySalesFigures'!$C$37)
C14C14=IF(C14='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesAugust2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesAugust2022.xlsm]MonthlySalesFigures'!$C$37)
C15C15=IF(C15='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesSeptember2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesSeptember2022.xlsm]MonthlySalesFigures'!$C$37)
C16C16=IF(C16='C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesOctober2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'C:\Users\Reception\QA Kitchens Pty Ltd\QA Kitchens Pty Ltd Team Site - QA Kitchens\Documents\Sophie Study\[QAkitchensSalesOctober2022.xlsm]MonthlySalesFigures'!$C$37)
C17C17=IF('https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesNovember2022.xlsm]MonthlySalesFigures'!$C$37=#REF!,"",'https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesNovember2022.xlsm]MonthlySalesFigures'!$C$37)
C18C18='https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesDecember2022.xlsm]MonthlySalesFigures'!$C$37
D18D18='https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesDecember2022.xlsm]MonthlySalesFigures'!$D$37
C19C19=SUMIF(C7:C18,"<>#REF!",C7:C18)
D19:G19D19=SUM(D7:D18)
E18E18='https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesDecember2022.xlsm]MonthlySalesFigures'!$E$37
F18F18='https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesDecember2022.xlsm]MonthlySalesFigures'!$F$37
G18G18='https://qakitchens.sharepoint.com/Shared Documents/QA Kitchens/Documents/Sophie Study/[QAkitchensSalesDecember2022.xlsm]MonthlySalesFigures'!$G$37
E20E20=SUM(C19:G19)


The December section was my link testing to an existing external workbook. I then tried to paste the link and change the file name BEFORE the November workbook file existed and came up with the #REF! error.
I then spent a lot of time trying to come up with methods to hide this error if the workbook doesn't yet exist which I thought I had figured out throughout the cells I then began filling in and adjusting the file names and cell references to suit.
I then remembered to try changing the original test format in November and again showed the #REF! error, and if I created a new file from template and named it and filled in some numbers for Person 1, January, it doesn't grab the data and I'm back to completely lost.
I thought I had it and now I don't and oh my goodness this project is the last thing to complete to finish my study and I just cannot do it.
Do you need me to include any minisheets of the other test referenced files or anything as well?
Am I maybe going towards a method that could work or just wasting my time entirely and really need to tie down my friend to help me understand your VBA Module methods?

Thank you I am so sorry I am so painful!
 
Upvote 0
Hi

One thing you need is to reference another workbook, so that was what I offered at post #4.

Find below links to two test files; the power query workbook is where the data is stored, while the welcome file is the master workbook. Here is what goes on each cell at the master:

C6 – path to PQ file

C7 – PQ file name

D6 – PQ sheet name

D7 – PQ cell

C8 – formula that retrieves value. If the file does not exist it returns a file not found message, however if the sheet name is invalid, it will return an error.

 
Upvote 0
Solution
Hi,
Thank you, I just wasn't understanding the 'how' or terminology I don't think correctly back at post #4.
I have tried implementing this and getting it to work various ways, but even on the straight Welcome to Excel file there is a #NAME? error which I have been unable to manage to fix.
I downloaded both files and tried pasting the file path entirely and also excluding the file name typed in C7 out of the path in C6 in case that was the problem but just continue to get the error.

Am I missing a step maybe?
I'm so sorry to be asking more!
Here is what I currently have in the test:

Cell Formulas
RangeFormula
C6C6="C:\Users\Signature\Downloads\power query1.xlsm"
C7C7="power query1.xlsm"
C8C8=getval(C6,C7,D6,D7)

I finally thought I understood with your explanation of what each cell contained but can't get it to work.
Do I need to learn how to add in the VBA module you mentioned as the other method of referencing in #4?
Thanks again,
Sophie
 
Upvote 0

Forum statistics

Threads
1,223,875
Messages
6,175,117
Members
452,613
Latest member
amorehouse

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