# Variable Cell Reference In INDIRECT Formula

Sep 28, 2006
I want to create a formula of the form: =INDIRECT(ADDRESS(4,2,2,TRUE,($A9) and insert this in a cell BUT the $A9 reference needs to reference the row of the cell where the formula is being inserted which will vary. ie. A30, A31, etc. How do I do this?

View 2 Replies
ADVERTISEMENT
Jun 9, 2009

I have this formula in excel 2007:

=COUNTIFS(Blad1!W:W;"1";Blad1!X:X;"H")+COUNTIFS(Blad1!W:W;"6";Blad1!X:X;"H").

Blad is Dutch for sheet, by the way.

In this formula, I want to let the ranges in Sheet1 be dependent of values in Sheet2. The formula itself is in Sheet2.

W must be replaced by the value of Sheet2!B12 and X to be replaced by the value of Sheet2!B9.

I tried this by using the INDIRECT formula, but the quotation marks of the search values are giving errors.

View 6 Replies
View Related
Oct 11, 2011

I need making a dynamic cell reference in an indirect formula, which looks at a different workbook.

The other workbook is called: ESF.xlsx

The sheet name in the other workbook is defined in Cell B2

The first cell i need to pull across is B115.

In cell B8, This is what i have so far:

=INDIRECT("[ESF.xlsx]"&B2&"!"&"B115")

How do i make it so that i can copy this formula quickly, but so only the row and column reference change?

Like in C8 i would want it to look at cell C115, In C9, id want it to look at C116 etc.

View 2 Replies
View Related
Jul 10, 2014

I am using the formula below to sum across several worksheets, and the formula I am using works fine, but when I copy the formula across to other cells, I can't figure out how to have it update my cell range:

=SUMPRODUCT(SUMIF(INDIRECT("'"&$A$1:$A$4&"'!A:A"),$B4,INDIRECT("'"&$A$1:$A$4&"'!G:G")))

The range A:A is ok to be static, but I need the G:G to be dynamic so when I drag it to the right it will change from G:G to H:H. I:I, etc.

View 6 Replies
View Related
Jul 15, 2014

I'm trying to use a variable as a cell reference in a formula using '&', but can't seem to get it to work. I've looked through the forum, which have examples of how to do this using a range, but not just as a single cell reference. This puts the formula '=VLOOKUP("A & lastrow &"" , Vlookupinput, 2,0)", which obviously gives me an error.

My code is:

Code:

Dim lastrow As String

lastrow = Range("A" & Rows.Count).End(xlUp).Row + 1

ActiveSheet.Range("A" & Rows.Count).End(xlUp).Offset(1, 1).Select

ActiveCell.Formula = "=VLOOKUP("A & lastrow &"" , Vlookupinput, 2,0)"

View 5 Replies
View Related
Jan 13, 2009

Not been around for some time now but have to do my annual update for this workbook and implement some new changes.

In the attached example workbook, I have created some formulas which reference a particular cell for each client e.g.

View 2 Replies
View Related
May 17, 2008

I will show with an example of what I would like to do. I italized and underscored the part of the formula.

---A----B

1 24 formulaB

formulaB = "= CELL("contents",DifferentSheet!G(A1))"

I want B1 to contain the value from the cell G24 in sheet "DifferentSheet". I want to use the value in A1 to determine what row on "DifferentSheet" I should use.

View 2 Replies
View Related
Dec 9, 2012

I have been using the following formula to do conditional summing over multiple worksheets:

=SUMPRODUCT(SUMIF(INDIRECT("'"&$AB$2:$AB$13&"'!b3:b39"),$B16,INDIRECT("'"&$AB$2:$AB$13&"'!c3:c39")))

The formula works fine, but when I drag it to the next column c3:c39 stays the same. How do I get that reference to change when I drag the formula over multiple columns.

View 1 Replies
View Related
Dec 3, 2007

COPYING indirect formula. When I copy, the lookup reference does not change. My formula is =INDIRECT("'"&$A247&"'!j106"). When I copy horizontally across cells, I want J106 to increase, ie j107, j108 etc. At the moment it remains at J106 and i have to manually increase the numbers by 1.

How do I change my formula so that the numbers increase automatically?

View 6 Replies
View Related
May 21, 2014

Attached I have a document where I am wanting all of the individual sheet names on the Total page. Rather than having to change each formula to match the sheet name I believe there is a way to reference the sheet name column (AO) in the formula so you can drag it down to fill in the columns. I am basic with Excel and do not know how to add this indirect function into my current formulas.

View 5 Replies
View Related
Oct 2, 2008

I'm trying to combine text and a cell reference using Indirect. Cell B1 contains the text "Region" (no quotation marks). In another cell I'm trying to create a reference to "Region total" (no quotation marks). By my limited understanding the below should work: =INDIRECT("b1"&" total")

But the cell returns #REF!. I've tried pretty much every combination of quotation marks around different elements of the formula I can think of. Cell B1 is a drop down list, don't imagine that's relevant, but it may be.

View 2 Replies
View Related
Jan 24, 2012

Trying to use INDIRECT to sum the contents of a column on another worksheet upto a certain cell reference which is in another cell on the worksheet.

=SUM(INDIRECT("Sheet1!A4:Sheet1!"&B1))

I have taken it back to simply having sheet1 with numbers in A4 to A23, then sheet2 with A23 in cell B1, and the formula above it C9, but I keep getting #REF!.

The formula works fine if on sheet1 without the worksheet names in it. Formula evaluation gets to =SUM(INDIRECT("Sheet1!A4:Sheet1!A23")) then gives =SUM(#REF!)

View 6 Replies
View Related
Mar 5, 2008

I have the following code which Clears the content of a cell. The next thing I want to have happen is to have another cell equal a formula but make that formula relative to its place. The formula is the following =IF(ISERROR(VLOOKUP(F56,Routes_All,2,0)),0,VLOOKUP(F56,Routes_All,2,0))

I am not sure how to paste it where the row changes depending on where it is pasted. Here is the code that does not work...

Private Sub CommandButton1_Click()

Worksheets("2008 Log").Select

Dim cRow

cRow = ActiveCell.Row '

Cells(cRow, Range("Column_Type_Of_Ride").Column).ClearContents

Cells(cRow, Range("column_duration").Column).value = "=IF(ISERROR(VLOOKUP(F56,Routes_All,2,0)),0,VLOOKUP(F56,Routes_All,2,0))"

End Sub

As you can see, no matter where I paste it it will always refer to row "F". How can I have it refer to row "cRow"?

View 2 Replies
View Related
May 28, 2008

I am trying to do a "getpivotdata" formula on a cell in certain file that gets info from a pivot table on another file. However the name of the second file (the one where the pivot table is found on) might be different each time so I created a variable for the second file name but I can’t figure out a way to use this variable in the get pivot data formula as I am not very experience with VBA.

Template = Application.InputBox("What is the name of the file ending with (.xls)")

If Template = False Then

cont1 = MsgBox("Please write the name correctly using (.xls)!", vbOKOnly)

If cont1 = vbOK Then

Exit Sub

End If

End If

View 3 Replies
View Related
Jan 9, 2014

I am an architect and recently I was required to do some extensive calculation relating to water requirements and toilet requirements for a building that i was designing. i created a excel file, with a basic vlookup function to put certain values in the cells that are pre-defined for a particular building typology (mostly created by governmental bodies as guidelines). for example, when i choose a particular type in column E, column F and G fills up automatically. now this table also gives me occupant load based on what is the area i enter in column D.

The problem is that I want to automate the calculation of toilet requirements. Now, each typology will have a different formula to calculate WC/Urinal/washbasin.

1. there will be 17 different formula - one for each typology (as shown in sheet 5)

2. Column j will calculate what is the number of WC required based on 2 criteria - first id what is the typology and then looking what is the number of occupant.

The problem here is for example, if in E9, selected typology as "offices", the formula of offices typology will be used in J9 and occupant value from H9 will be used but if i have E18 also selected as offices typology, the same formula will use occupant value mentioned in H18 instead of using H9.

Hence, excel will first have to look what is the typology selected. based on that, it will load formula - out of that 17 different formula - specific to that typology and finally it will refer to corresponding row for occupant load and will use it in the formula to get the result.

View 3 Replies
View Related
Apr 11, 2007

I have counted the number of rows using i. Now I need to pass that variable to the ActiveCell referances shown.

Do While Not Selection. Offset(i, -6) = ""

ActiveCell.FormulaR1C1 = "= round(R[i]C[-8],2)&""±""&round(R[i]C[-7],2)"

ActiveCell.Offset(0, 1) = "=round(R[i]C[-7],2)&""±""&round(R[i]C[-6],2)"

ActiveCell.Offset(1, 0).Select

Loop

End Sub

View 9 Replies
View Related
Feb 17, 2012

Reduced to it's simplest form I have a formula

=1*(FY2012_TY), where FY2012_TY

is a Defined Name which refers to a column on another tab in the workbook, and is defined as:

=OFFSET(Table!$AA$3,0,0,COUNT(Table!$AA:$AA),1)

What I would like to do is to come up with an approach to this formula that would allow me to drag it across columns and have the year automatically increment (e.g., FY2013_TY, FY2014_TY, all of which are similarly defined Defined Names referring to adjacent columns). I have tried various approaches using INDIRECT along with CONCATENATE, but when it comes down to evaluating the formula, I consistently get a #REF! error.

View 4 Replies
View Related
Feb 1, 2009

I have an income statement with the cities on top (column header) and the expenses below it. There are 5 cities for example. The last line is net profit before it changes to the next city.

New York (column header)

Wages

Lights

Net Profit

Boston

Lights

Wages

Sales

Net Profit

How do you get the row reference for Boston Net Profit without using the offset or indirect function? (doing external linking with workbook closed) The formula would find Boston first and then look for the first net profit after Boston? The small if function may work for this.

View 9 Replies
View Related
Jan 10, 2010

I have a formula that pulls data from another sheet using standard reference of sheetname! I want to build this forumla to use several sheets, and would like to pull the sheet names from other cells.

For example... instead of LEMONS!a1 and LIMES!B2

I would like to use REF1!a1 and REF2!B2

where REF1 and REF2 are pulled from cell Z1 which contains test 'Lemons' and cell Z2 which contains text 'Limes'

How can I do this?

View 9 Replies
View Related
Feb 22, 2012

I have a spread sheet that lists a bunch of dates and expected volume that will be associated with the date. I need to build a macro that will look at the first date expand it out for several months then look at the volume and break that out over a week's time.

That part is simple enough but I need to turn this into a looping statement and I cannot figure out a way to get my macro to always come back to the next date in my list.

Ideally I would like something that is a variable that references the cell I want so I can do something like this.

Code:

MYRANGE = range("B2")

Do

range(MYRANGE).select

[Code]....

This should work for me perfectly if I can just figure out how to make the MYDATE varaible reference a sepecific cell rather than a value or text in the cell.

View 2 Replies
View Related
Jul 9, 2008

i'm trying to use the sum across sheet function - i.e. - =SUM(Start:End!B1)

Whereby "Start" and "End" are the two relevant sheet names and "B1" is the cell I want added up.

However, can I make B1 variable, whereby there is a cell, say in A1, that contains the string "B1", so that I can make it sum C1 or B20 or anything on the other sheets?

View 9 Replies
View Related
Aug 14, 2006

I have the following formula in cell L51 of all sheets calculating the volume depending on the monthly index that is chosen from the drop down menu in a particular sheet. =If(MIndex=0, SUM(D33:L50),If(MIndex=1,SUM(D34:L50),If(MIndex=2,SUM(D35:L50), 0))). I am getting the following message and I do not understand what it is about.

Microsoft Office Excel cannot calculate a formula. Cell references in the formula refer to the formula's result, creating a circular reference. Try one of the following

View 3 Replies
View Related
Feb 13, 2014

Is there anyway to add text to an INDIRECT reference so that it will now reference a new range?

For instance, this is my formula...

=IF(INDEX(INDIRECT("A1+TM"),MATCH(B2,INDIRECT(A1),0),1)="","-",INDEX(INDIRECT("A1+TM"),MATCH(B2,INDIRECT(A1),0),1))

I am trying to say, if the cell 1 column to the left of the cell that matches the text in B2, in the cell range referenced in A1 (CWS) "added to the text "TM", is blank, then write "-", otherwise return the number in the cell 1 column to the left of the cell that matches the text in B2, in the cell range referenced in A1 (CWS)+"TM".

Cell A1 is a data validation list that refers to different ranges. The only difference between those named ranges and the named range I want to reference is the text "TM" comes at the end.

View 3 Replies
View Related
Jan 17, 2008

I am writing a formula in cell "B1" in "December 2007 REVISED BY DAN.xlsm" that will reference cell "X1" in a workbook that has not been created yet.

The way I will tell the formula what the name of the workbook will be is by referencing cell "A1" and adding the extension ".xlsx" to it.

Example: ...

View 14 Replies
View Related
Feb 7, 2012

I have the following formula which i'm using to indirectly reference a worksheet. The worksheet i'm referencing includes named ranges that i'd like to call on but i can't get the syntax right.

Code:

=SUMPRODUCT(--(INDIRECT("'"&HH_Elec_Title&"'!B15:B19")>=D5),--(INDIRECT("'"&HH_Elec_Title&"'!B15:B19")

View 6 Replies
View Related
Oct 15, 2013

I am trying to use the sumif and indirect function together but I keep getting an error and I'm not sure why.

Actual formula:

=SUMIF('SWG OR'!B:B,A168,'SWG OR'!E:E)

Using the sumif/indirect function, I have the following:

> Cell B5 contains the name of the tab "SWG OR"

=sumif(indirect(B5&"!B:B",A168,B5&"!E:E"))

View 2 Replies
View Related
Jun 26, 2014

Just wondering if there is a way to indirectly reference a workbook in a formula?

For example, suppose A1 has the path/filename of the workbook I want to reference.

So in another cell I want to do, say, a VLOOKUP(A2,A1,5), where A2 is the lookup value. This way, if I have multiple workbooks I want to look at, I can specify them all in various cells, and simply have the formula look at the right cell to perform the lookup.

I've played with INDIRECT and get something close if I do

=INDIRECT("'"&A1&"'!A1:AJ1500")

but that just returns the contents of A1 in the target sheet.

View 1 Replies
View Related
Mar 12, 2008

I'm having difficulty referencing named ranges indirectly in a VLOOKUP formula (Excel 2003).

Cell A1 contains a fuel cost.

Cell A2 contains a formula that returns a RangeName.

In Cell A3, I want to enter a VLOOKUP formula that uses the range returned as the result in Cell A2 as the Table_array. In other words: =VLOOKUP($A$1,$A$2,2,FALSE). The result is #NA!.

If I use =VLOOKUP($A$1,INDIRECT($A$2),2,FALSE), I get #REF!.

Among other things, I've also tried =VLOOKUP($A$1,TEXT($A$2,"@"),2,FALSE). No cigar.

View 9 Replies
View Related
Feb 22, 2010

I have a worksheet with a name that inckudes a hyphen, e.g. 1234-5678.

And I have the worksheet name in a cell, say, I!.

Using

=INDIRECT(I$1&"!YADDA")

I get a REF error because of the inclusion of the hyphen in the worksheet name.

How can I fix this without eliminating the hyphen?

View 9 Replies
View Related
May 29, 2012

I am building an Excel sheet for my company which keeps track of who has done what with a new client in a step by step process. I have it set up so that once a department clicks complete in a box it automatically emails (VIA a macro) the next person who needs to do the next task. Some tasks are done by the same person no matter what, other tasks are done by a project leader which is different depending on the client.

The problem I'm having is that, within the macro, I need to reference an email address in a cell X cells to the left in the ".TO" line.

So, in Column A I have the CLIENT, Column B The PROJECT LEADER, and Column C The PROJECT LEADERS EMAIL. Then the next 22 Columns are labeled steps with drop down boxes, once the have selected "COMPLETED" it triggers the macro and send the email, just not on the ones when it needs to email the PROJECT LEADER, since it's a variable. Below is the macro, how I can have the ".TO" line in the email reference the email address in Column C to the left of it?

Sub Mail_Workbook_1()

Dim OutApp As Object

Dim OutMail As Object

[Code]....

View 2 Replies
View Related