# Sumif - Reference To Cell On Another Worksheet

Feb 27, 2007

I'm trying to reference a cell on another worksheet in my criteria and the formula doesn't seem to be working. All I get is a value of 0.

= SUMIF(G3:G76, ">='City Wide'!B6",I3:I76)

If I replace 'City Wide'!B6 with an actual number the formula works. This does not help as 'City Wide'!B6 is a value that can change.

## Using Sumif And Indirect To Reference Another Worksheet

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"))

## SUMIF Formula With Reference To A Cell

Jun 29, 2006

I attached a file I made conditional formatting on cells C4..G6 which makes any number less than value in cell C15 invisible. In line " Total" I used SUMIF formulas which ignore any value less than 30. However the formulas should not contain static numbers but rather a reference to cell C15. But I simply cannot make it work.

## Convert Cell Reference To Worksheet Reference

Jul 20, 2014

I have a workbook with 1000+ worksheets, all of which have 3-letter names. On a master sheet, I would like to make a query of how many non-empty cells there are on a subsidiary worksheet. This works:

Code:
=COUNTA(ABC!A:A)
What I'd like to do from time to time is input in column A a varying set of 3-letter worksheet names, say

AAB
ABC
CDE

And have a formula in column B that converts this to

=COUNTA(AAB!A:A)
=COUNTA(ABC!A:A)
=COUNTA(CDE!A:A)

I've learned that simply substituting the cell references A1, A2, A3 for AAB, ABC and CDE doesn't work. What do I need to do to achieve this?

## Reference Last Row In Sumif VBA

Mar 20, 2009

I recorded this sumif in VBA, but know I am trying to figure out how to tie in the last row reference in place of the 27.

=SUMIF(\$AR\$2:\$AR\$27,\$AR29,AS\$2:AS\$27)
FormulaR1C1 = "=SUMIF(R2C44:R27C44,RC44,R2C:R27C)"

## Using Cell Value To Reference Worksheet Name?

Aug 5, 2014

I have a worksheet with additional worksheet name listed in Column G, starting in G3.

I want to run this formula on each sheet, using the value in Column G as the WORKSHEETNAME.

=COUNTIFS(A7:A1000,">12/31/2010",A7:A1000,"<1/1/2012",F7:F1000,"Excluded")

Faulty example of what I'm trying to do:
=COUNTIFS('WORKSHEETNAME'!A7:A1000,">12/31/2010",''WORKSHEETNAME'!A7:A1000,"<1/1/2012",''WORKSHEETNAME'!F7:F1000,"Excluded")

I've tried INDIRECT, but I cant seem to make it work.

## SumIf Reference To Date

Jan 18, 2010

How can I reflect the correct trainee count for Day1-Batch1?

Currently columns F,G,H computes for expected, actual and total variances of trainee respectively reference to the training date J3.

Since this is a 2-day per batch even, I could not capture the 1st day trainee total of every batch because I divide the sum by 2 (2 day / training batch). The sum is only corrected on the 2nd day.
Attached herein is the sample file.

## Sumif With Named Reference

Sep 15, 2006

See attached for an example. I'm trying to use the SumIF funtion with a named reference as the criteria. Here is my formula. =SUMIF(B10:F10,"<MinReq",B10:F10) It keeps returning 0 even though there is valid data.

## Use A Worksheet Reference Cell In A Formula?

Apr 10, 2014

I have a formula to extract the worksheet name and add the "!" to it so it can be used in a copied formula... I'm just having trouble writing the formula to reference the text in the cell with the worksheet name. If it's easier, I also have the list of worksheets without the "!" - e.g., Sheet1, Sheet2, Sheet3, etc...

I want the formula to calculate, in my example, the sum of 2 cells on a different worksheet.

## Reference Cell On One Worksheet In Right Footer Of Another?

Jan 7, 2014

Been having some trouble with this using VBA. I can't seem to get the code to run properly.

Actually, if there is a way to get a right footer on one worksheet to be referenced in a cell on another, that would be even better but I haven't been able to find anything like that.

## VBA Code For Using Cell Value To Reference Worksheet Name

Jul 15, 2014

I need a VBA code to reference the cell value to activate a particular worksheet name. In the sheet "Ini", Range ("B4"), there is a text of "Rawdata" This text is used to reference to the specific Sheet name and activate it.

However, I am unable to get my code to work. Thus, I changed it with a ' with green highlights for the following lines:

'Worksheets.Open Filename:=DataRawSheet
'ActiveSheet.Range("A1").Select
Reference_Cell_to_Sheet.xlsm

## Reference Cell From Another Excel Worksheet?

Dec 6, 2013

I've done this loads of times before but doing it this morning seems to not be working at all.

Previously I'd be in Sheet 1, I put the equals sign, I click into Sheet 2 in the cell I want, hit enter, and hey presto the external cell is referenced in Sheet 1.

However, what I'm trying to do here is not reference individual sheets within an excel document, but reference a totally separate Excel document. Can I do this or not?

If so how? Because when I select the second worksheet after I've entered the = sign, it just takes me to the second sheet - it doesn't seem to 'remember' that I'm in the middle of a formula.

## Reference Worksheet Cell In Workbook

Aug 12, 2006

I have recently learned a little about Excel. Enough to be able to do our payroll for my company on it. My question is: On the 1st page of my workbook, is my quarterly report which shows all taxes, social security, and medicare we hold out each payday for each employee. The rest of the worksheets are for each employee. How do I have each employees withholdings automatically go to my quarterly report page?

## Open A Closed Worksheet W/ Cell Reference

Jan 4, 2010

I am trying to open a stored file on a network drive (with the file location stored in cell E4). When I try to run the macro, I get an error message on Line 3. (Sheets(E4.Value).Activate)

Does anyone know what I can do to fix this, or have a better method to open the closed files?

I've read that it's possible to reference information from a closed sheet, but I don't think that I'm experienced enough in VBA to take on that effort yet.

## Using A Cell Reference To Copy Rows To A New Worksheet

Jun 14, 2006

I've been tasked with redoing a revenue report at work, and in my head I've conjured up what could potentially be a huge time saving way of doing things in the future, although have searched help files and looked around online and can't find the formula/macro (if it exists) to enable me to do this.

The problem is this:

Sheet 1 of the workbook is a large input sheet. Every row contained in that sheet will, in column A, be titled 'red', 'yellow' or 'green'. Columns B onwards contain other data which (at the moment) is irrelevant to the problem.

Now what I want excel to do after I've put the raw data into the input sheet (sheet 1), is to read the text in column A for each row, then automatically copy ALL data in that row over to the next empty row on another worksheet.

ie Sheet 2 will have all rows that have 'Red' in column A on the input sheet, Sheet 3 will have all those titled 'Yellow' and Sheet 4 will have all those titled 'Red'.

I know I can use a filter on the input sheet to just show the data I want, but each colour coded row will contain different data to another, and if there is a formula/macro setup i can use to do the above, then I can set the subsequent worksheets up to hide the superflous columns from the input sheet.

## Reference Cell For Worksheet Name Macro Code

Apr 11, 2008

I've got 3 sheets, A, B, and C. In sheet C, I have a cell named "element". That cell can have either the letter A or the letter B in it. In my VB code, I want to reference the sheet which correlates with the "element" cell. So,

Worksheets("element").Select

when the user clicks my "go" button, it calls this logic, and I want the worksheet that correleates to the letter in the cell in worksheet C - to open.

The reason for my posting - this is not working, and may not even be possible. Perhaps someone has experience in this and knows how to do it - or knows a different way to do this.

## Highlight Cells Based On Cell Reference On Another Worksheet

May 27, 2014

I am trying to find a way to automatically highlight all the cells specified by the cell references in a column on another worksheet (which will constantly have new values added).

On the attached sample, the 'Data Before' tab shows the base data before any highlighting. As cell references are added to the 'References' tab in 'column A' I want the respective cell to be highlighted on the 'Data Before' tab resulting in the 'Data After' tab and each time a new cell reference is added to the 'References' tab, the respective cell is then highlighted on the 'Data Before' tab.

I would like to have control over the highlight colour so that a different highlight colour can be specified for each date change, i.e. all cell references that are shown on the same date are the same colour but where the date changes a different highlight colour can be specified.

Highlight by Cell Reference.xlsx‎

## INDIRECT - Sum Contents Of Column On Another Worksheet Up To Certain Cell Reference

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!)

## VBA Script To Create Excel Reference To A Cell In Different Worksheet

Dec 18, 2013

I am trying to create a budgeting spreadsheet that contains 26 worksheets that represent 2 week expense cycles. The worksheet will tally all the expenses in its 2 week cycle, compare them to a target budget, and calculate the remaining budget. I would like to roll the remaining budget over to the next 2 week budget cycle by having a cell refer to the remaining budget in the previous worksheet.

I am trying to accomplish this using the following VBA script. I get an error (Run-time error 1004: Application-defined or object-defined error) on the 3rd to last line of the code. I think the issue is with how I am constructing the wsReference variable. I have seen other codes do something similar (VBA - How to refer to a different worksheet cell) but I am not having any luck.

Sub Budget_Rollover()
Dim i As Long
' Loop through all the worksheets, starting with the second sheet
For i = 2 To Worksheets.Count
Dim wsReference As String
Dim wsName As String
' Define the name of the previous expense cycle worksheet

[code]......

## Macros To Save Worksheet Based On Cell Reference

Feb 12, 2009

I have a macros ( code inserted ) as you can see in my code the macros save the workbook in any file name you chose just by changing the any filename option.

I would like this to be changed so that it saves based on a cell reference, say i has a name in lets say B10 i would like it to save as the name in B10.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim bk1 As Workbook
Dim bk As Workbook
Dim myfilename As String

## Formula- To Pull Cell Values Similar To A SUMIF Function (SUMIF(range,criteria,sum_range))

Oct 25, 2007

I am trying to pull cell values similar to a SUMIF function (SUMIF(range,criteria,sum_range)). For example, in A1 I use a data list created from data elsewhere on the spreadsheet. In the data I created elsewhere, there are 2 columns being used. The 1st column is the information that is being used to create the list and the second column contains specific values (number or text). In the dropdown menu I select an available value (text or number) . When I have selected that value I would like cell A2 to show what the cell directly to the right of it shows from the data I have elsewhere in the spreadsheet as mentioned. I have tried the SUMIF function however it seems to exclude certain values (number or text) and I am not sure what else to use.

## Dynamic SumIF Formulas That Reference Changing Codes

Dec 1, 2007

I have a list of codes from which I'm trying to extract all unique entries.

For example, col A has 001, 001, 002, 003, 003, 003, 004, ...

I'm trying to create a report template with formulas that reference col A and return a single unique entry for each code so that the new column has only 001, 002, 003, 004.

Essentially, the codes reference customers. A customer can have multiple purchases -- but I'm trying to create a report in which I can utilize SumIf formulas to Sum the purchases for each customer and represent those purchases on a single line per customer code.

The catch is that the purchases change monthly (i.e., next month the purchases may be 001, 002, 002, 002, 004) so my report template needs to have the flexibility to adapt without me rewriting the SumIf formulas and return SumIf results for only customers 001, 002, 004. Whereas in the prior month, the report returned SumIf results for customers 001, 002, 003, 004.

## Macro Used Textbox In Worksheet Rather Than Cell Reference As Criteria To Find Matches

Sep 26, 2013

This is a continuation of thread 182629 [URL] ....

The End User wanted originally to type characters into cell C1 of a worksheet that the macro searched for in another worksheet, copying across every row containing the input.

The responses gave me the following code which worked perfectly:

VB:
With Sheets("PICKLIST")
myFind = "*" & .[c1].Value & "*"
End With
If myFind = "*" & "" & "*" Then Exit Sub

Unfortunately, the user NOW wants a Text Box instead of putting the characters into a cell.

I added a textbox (originally called 'TextBox2' but renamed "Choice") and "Dimed" CHOICE As Range.

Then tried the following code:

VB:
With Sheets("PICKLIST")
myFind = "*" & CHOICE & "*"
End With

But it generates a "RunTime Error 91" - Object variable or With block variable not set.

## Excel 2003 :: Copy Data And Then Increment Cell Reference From Different Worksheet?

Nov 28, 2013

I've got 2 worksheets in the same workbook.

Sheet 1 contains huge amounts of data - thousands of rows and multiple columns

Sheet 2 - I want to extract the data from sheet 1 column A into sheet 2 column A but only the data from every 21st row.

I want to be able to copy the formula automatically down, otherwise it will take hours to do it manually. So far I can only get the cell reference to increment by 1 each time after copying.

So what I'm trying to achieve is :-

Sheet 2 A1 = Sheet 1 A1
Sheet 2 A2 = Sheet 1 A22
Sheet 2 A3 = Sheet 1 A43

## Excel 2007 :: Email Current Worksheet And Rename It From Reference To A Cell

Oct 25, 2012

I have the need to email the current worksheet in Excel 2007, which I have been able to do with the following ...

Sub SendTab()
'Declare and initialize your variables, and turn off screen updating.
Dim wks As Worksheet
Application.ScreenUpdating = False
Set wks = ActiveSheet

[Code] .......

Is there a way I can also get it to also rename the sheet from the default "Book1" to the information in a referenced cell.

## SUMIF And SUMIF Not - Using Two Formulas In One Cell

Feb 27, 2012

I am wanting to use these two formulas in one cell. Is there anyway to do this? If "AD3" is 0 I want this =SUM(X3:AC3) and then if cell "AD3" is greater than 0 I want to basically use this formula

Is there anyway to merge these two formula's?

## Create A Separate Worksheet That Has The Data In And Reference Cells On Budget Worksheet?

Feb 7, 2014

I need to reference the projected and actual expenses from the total on worksheet 'expenses' So i did so, however, if I change the drop down on the expenses worksheet to only display housing data, then the projected and actual expenses on my budget worksheet changes as well to the new data portrayed on the expenses worksheet.

I need to reference the cell, without it changing when I change the category display, but I need the cell to change accordingly if I enter new data in the overall tablet on the expenses worksheet.

Or do I need to create a seperate worksheet that has the data in and reference my cells on my budget worksheet to that new worksheet?

## SUMIF Data From Different Worksheet

Jun 20, 2014

I need to sum all values in column I from worksheet CostTrack if the cell in same row in column D is the text I am wanting.

For example, this formula will be in worksheet Recap C3:C25

In Recap Column B3:B25 would be the exact same text as in column D from CostTrack.

So I think it would something like this:

=SUMIF(CostTrack !I3:I25, IF(CostTrack !D3:D25="B3",

And then I don't know how to finish this out or if this is close to being correct.

## Change Formula Cell Reference Based On Another Cell Reference

Jan 8, 2012

How do I change a formula cell reference based on another cell's reference? I'm building a schedule that looks to a task's trigger and adds days based on that relationship. All entries in column "A" will be text and all cells in "B" will be the simple formula "=A2" or "=A3". Due date is calculated by adding the value in "C" to the preceding date in column "D". In the spreadsheet below, the trigger for "Budget set" is "Specs written" with 3 days added to the previous due date.

________A________________B_____________C_________D
2 Design begins__Proj OK______________10____10-Jan
3 Specs written__Design begins (A2)____5____15-Jan (D2+C3)
4 Budget set_____Specs written (A3)____3____18-Jan (D3+C4)

If the trigger for A4, "Budget set", changed from A3 to A2, is there a way that the formula that determines the due date in D4 could read the trigger cell reference in B4 so that the value in the corresponding row in column "C" is added in the date column?

## Absolute Reference (cell Reference Behind The Table)

Mar 11, 2009

I have a table that displays data from another worksheet. This is what the cell reference behind the table look like: