# Moving Cells Without Losing Correct Reference To Formula

Jun 27, 2014

How to make a formula with references to certain cells, so I can sort the sheet but keep the formula referring to the same cells as before the sorting?

In the example I illustrated the problem: when I sort the data, the formula refers to the same cells which have now different values, so the calculation is not right anymore.

## Countif Formula: Added The Correct Amount In The Correct Cells

Feb 15, 2010

I'm trying to create a formula that will added the correct amount in the correct cells, I have create a dunny sheet in trying to achieve this. If Cell B8:B11 = ABS or Dum that any points won should be added to Cell L8:L11 right now its adding it into K8:K11. If Cell B8:B11 = is Blank any player points should be added to cells K8:K11. I'm using this formula throughout cells K8:K28 =IF(J8>J25,1,IF(AND(J8<>0,J8=J25),0.5,0)) Any thing in red is incorrect anything in blue is what I'm trying to achieve.

## Correct VBA Syntax To Reference Cells In Functions (Correlation)

Jan 27, 2009

I trying to populate cells with a correlation function using VBA, I have set up dynamic references/arguments for the fuction to take on however I just can't get it to work. Currently instead of populating the formula into the cell, it's just populates it as a string based on what's entered below =correl(Ystart &":"& yend, xstart&'":"'& xend").

FYI - The correl function takes on two ranges,. I've predefined these below.

Sub testing()

lastcell = ActiveSheet.Range("c575").End(xlUp).Row
firstcell = ActiveSheet.Range("c1").End(xlDown).Row

Ystart = ("b" & firstcell)
yend = ("b" & lastcell)

xstart = ("c" & firstcell)
xend = ("c" & lastcell)

Range("c575:c580").Formula = "=correl(Ystart &":"& yend, xstart&'":"'& xend")"

'this works
'Range(xstart, xend).Select

End Sub

## Check Cells Are Correct Format And Contain Correct Data

Jan 26, 2014

We receive about 20 sales files of several hundred lines of data each day from various agencies. I want to create a macro / VBA code which checks that the data submitted is correct so that we can upload it into our database without import errors and / or having to manually check each line of data.

I envisage something like an output report:

#####################
149 entries
Column A - Date - OK
Column B - Customer_Phone - Errors (Should be 11 digits)
Row 21 - Customer_Phone - Error (Not 11 digits)
Row 108 - Customer_Phone - Error (Contains letters)
Column C - Outcome - OK
Please correct and re-check.
#####################

## Cell Reference :: Formula To Reference New Cells

Feb 15, 2010

I have lets say 12 months of data. I have formulas that reference the latest 6 months. When I insert a new column to input a new month, how can I make the formulas include the new months without manually updating them.

EXAMPLE:

12 months of data exist in cells B3:M3 going from B3(oldest) to M3(newest). Formulas reference latest 6 months of data in cells H3:M3. When a new month hits, I insert a column after column M.I would like the formulas to now reference cells I3:N3 which is now the newest 6 months.

## Avoid Losing Worksheet References In Formula?

Jan 14, 2013

Is there a way to prevent formulae from losing their references when the references get replaced.

I have formula which refer to a worksheet that is dynamic, meaning that the worksheet holding the data (CONTROL_1) differs from one query to the next is imported from another source. The datasource contents and format are identical.

## Correct Way To Reference A Question Mark And A Period (Apostrophes And Quotation Marks)

Apr 20, 2009

This question is about punctuation.

I know the following is a correct way to reference a question mark and a period....

## Combining Contents Of Multiple Cells Into 1 Cell - Without Losing Data

Jun 5, 2013

Collapsing function: I want to select cells that I want merged, and have them COLLAPSE into the first cell selected calls
Combining function: OR Select the cells I want merged, and allow me to pick a destination cell for the result COMBINE

I would like to add this functionality to all my spreadsheets in the future.

Excel-Forum-Data Collapsing sample.xls

## Reference Moving Range In Macro

Sep 4, 2007

I want to search a word in my Data sheet and want to know what is the column position. Example: I have a word "LastName" as a Column header in my Datasheet whose column position can be anywhere in the datasheet based on the table selected. So i want to write a generic code which give me COLUMN position for this word in the datasheet.

So if "LASTNAME" header is coming as 7th column it return me 7
if "LASTNAME" header is coming as 9th column it return me 9.

## Formula To Reference Another Workbook Using Cells

Nov 19, 2003

I'm trying to do: In Book2.xls, Sheet1, Column A, I have a list of tab names in another workbook (2003 Com October.xls). In column B of Sheet1, I want to utilize what's in column A to pull data from the correct tab in 2003 Com October.xls. Here's what the result should resemble:

******** ******************** ************************************************************************>Microsoft Excel - Book2___Running: xl2002 XP : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutB2B3B4B5B6B7=
ABCD1Onyx*IDName**2acgattikhickert**3acgattikhickert**4acgattikhickert**5acgattikhickert**6agomesnbizman**7athomasmweaver**Sheet1*
[HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.

## Use Cells For Start & End Formula Reference

Jan 5, 2008

I'm using this formula (in Cells D4:D10) to tabulate hours being spent on various testing activity categories (N,O,R,E,U,A,D). Is there a method I can use to permit me to change the range of cells being tabulated using Named Ranges or some sort of substitution?

= SUMIF(\$C\$15:\$C\$89,C4,OFFSET(\$C\$15:\$C\$89,0,4))

for example I would like to use the value I present in cell A2 as the starting point (for the range) & B2 as the end point (for the range) of cells being evaluated. In other words the improved formula would look like this.

=SUMIF(A2:B2,C4,OFFSET(A2:B2,0,4)) -or something like that-

See attached for reference!

## Excel 2007 :: How To Change Autofill Options Or When Moving Right In Row Reference Down A Column

Apr 15, 2014

I'm working on a decision matrix to evaluate different alternative production methods. Before that criteria have to be choosen and weighted against each other. The user would fill out the yellow/ blue cells with (0=less important; 1=equally; 2=more). Then values are added up and put into some kind of ranking.

The example was done by hand, which costs a lot of concentration. I would now like to extend the matrix - do you know how to fill out the grey cells more efficiently?

(Excel 2007, Win7)

## Formula Reference Cells & Ungroup Worksheet

Oct 21, 2007

"Enter a formula that adds the total gross sales for the first quarter in cell B6 in the Q1 worksheet and total gross sales for the current quarter in cell G18 in the Q2 worksheet"

**First ungroup the grouped worksheet

How am i going to formula a total gross that i don't even know what is the first quarter? i don't see anything for first quarter? and in Q2 worksheet G18 i already did =SUM formula Ungroup the worksheet? i don't think my worksheet is even group?? how i ungroup it?

## Column Formula That Won't Change When Move Reference Cells

May 22, 2014

I'm dealing with forecasting invoices. The main column 'BALANCE' has a formula referencing the previous cell and then adding or subtracting invoices (ENTRY). The problem I have is that I'll put values in ENTRY that I expect to come in at some point but as they arrive I need to change the order of the cells. So I'm constantly changing the order and then it changes the formula in BALANCE. I tried absolute cells (and even found a work around way to flow absolute cells by flowing then viewing formulas then using the replace function but that didn't work.

So my formula in BALANCE is:
=\$I\$173+\$E\$174-\$G\$174

but if I move G174 to another cell I'd like to keep the BALANCE formula to stay G174 instead of following the move.

## Insert Formula Based Off Changing Reference Cells

Mar 6, 2014

i need a macro which puts the formulas into the cells as per attached.

the number of rows between the "beam" can be variable
the number next to the beam will be variable.
the number of "beam" rows is vaiable

my thoughts where to do a find"beam" and refernce the cells address the create formulas off those points but dont have the skill to code this

beam macro.xlsx

## Count Used Cells Formula. Make Reference Static

Nov 5, 2006

I have a problem using indirect in a counta function. Basically, I want to count the number of used cells in a range. However, there would be insertions to the rows (using the insert row) on top of the range.

my function is now =counta(indirect(" events database"!"A"&M22&":A"&M500)

However, this formula returns an error. What have I typed wrongly?

## Copy Pairs From 2 Columns To Formula Reference Cells & Copy Updated Formula Results

Jun 24, 2008

I am currently working on a data analysis project (data mining) and need to collect and later analyze statistics for the inputs which control a series of calculations. These statistics are shown in the Statistics 1, Statistics 2 and Statistics 3 cells in the workbook that I attached. The inputs are X,Y; all possible values for these inputs are listed in the N,O columns. Basically I need a macro which would take the values from these two columns and place them pair after pair into the controlling cells (K3, L3), then it would copy cells H2 through L3 (updated stats) to a new sheet after each copy operation - so that I will finally have a list of statistics for all of the input pairs.

## A Formula To Reference Another Page And Skip Cells To Get To Desired Results?

May 14, 2014

I am trying to find a formula that will allow me to reference another page in my spread sheet. In my scenario the row I am referencing has 5 consectutive numbers after the reference point I would use for a vlookup. These numbers are all zeros except for one number in each row which will be a positive number greater than zero. I want my formula to check the first cell in the row, if it is not a zero it will show that number, but if this cell contains 0, then it moves over to the next cell. If all the cells in the row have a zero, then i just want zero to appear on my summary sheet. I tried to do a vlookup with an IF function, but I couldn't get it to work. I have attached a sample of what the spreadsheet looks like.Example doc.xlsx

## Copy Formula With Absolute Reference & Increment Row Number Every X Cells

Mar 25, 2009

I am creating a spreadsheet which creates a bulk of data from a front sheet.

The question is:
Is there a way to automatically copy a fixed formula for 100 cells using one fixed cell reference such as \$A\$1 and then automatically after 100 cells replace \$A\$1 with \$A\$2, after another 100 with \$A\$3 and so on?

Explanation with Example:

For example, Sheet1 contains the words "Green Tree" in Cell A1 and Sheet2 will then place "Green Tree" into 100 different sentences such as:

Plant a Green Tree
Grow a Green Tree today

This would be created with the formula ="Grow a "&'Sheet1'!\$A\$1& " today"

After 100 different variations using the formula I want to change that formula to reference cell A2 on Sheet1.

I know if I place "Red Tree" in Cell A2 and use the formula ="Grow a "&'Sheet1'!\$A\$2& " today" I can do this manually using find and replace for the 100 cells, but I want to do this for 100 different variations of Green Tree to create a 10,000 different sentences so I'd need to find and replace 100 times!

## Drag Copying Formula Down While Skipping Cells In Adjacent Reference Column?

Feb 2, 2014

I have a spreadsheet with temperature data, all in one column (D), that was recorded every 10 minutes for several months. In two adjacent columns (E & F), I would like to record the daily max and min temperatures. I can manually do this with MAX and MIN formulas in column E and F respectively, MAX(D1:D144). But when I copy this formula to the next row, I get MAX(D2:D145) when what I really want is MAX(D145:D288)....and so on...

## Copy Selected Cells And Paste As Formula With Original Cell Reference

Nov 20, 2012

Wanted to know if there is a macro that can copy the selection of cells and paste it as a formula with original cell refernce.

For Example :

Copy Selection Cells - Say Cells A1 B1 & C1
and Paste It as formula In Cell D1 as =A1+B1+C1

## Index Or Match Formula: When A Reference Number Is Used - It Popluates Cells From A List

Jun 6, 2006

I am looking for a formula or something - that when a reference number is used - it popluates cells from a list. Attached is a sample spreadsheet - 2 worksheets are being used - 1 is Purchase List and the 2nd is Fax Commitment. When reference no is filled in on the Fax Commitment sheet and it = the same reference no as on the Purchase List - I need it to populate the appropriate fields (in this case I have colour coded)

## Cell Reference- Able To Reference Two Cells To The Left Even As More Cells Are Added

Jun 11, 2008

I have 5 columns set up: A,B,C,D,E
D is the sum of A and B
E is the sum of A,B,and C

As I add in a new column to the right of C (call it C2), I need D (which has shifted over one) to sum A,B, and C.

I also need E (which has also shifted over one) to sum A,B,C, and C2.

Essentially I need a function in a cell that will be able to reference two cells to the left even as more cells are added.

## Formula Cell Not Tampered And Correct Formula

Feb 27, 2012

I have two questions:

1. Is there a way cells with formulas cannot be tampered even if they are not locked? So when I enter a data on a cell with formula, the formula won't be erased? The sample below shows that C1 and C2 has formulas but let's say I enter a value on C1, the formula should still stay? Is this possible?

A B C
1 5 10 =SUM(A1:B10)
2 2 4 =SUM(A2:B2)

2. Let's say I have a total of 125 (A1) and I need to get the answer (B1) where it has 5 with No. 3 on top (subscript) of 5? How to create a formula for this (I hope I make sense)?

## Circular Reference: Cell References In The Formula Refer To The Formula's Result, Creating A Circular Reference

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

## Sumproduct- Counts The Correct Amount But Not With The Correct Dates

Jul 3, 2008

I have a table with 3 columns of dates and then a column with Set # that I
feel in the box #.

I need to see how many items processed for each set per day.

Example:
[url]

The problem is that it counts the correct amount but not with the correct
dates.
The formula that I use is:
=SUMPRODUCT(--(\$I\$3:\$I\$8<>"")*((\$C\$3:\$C\$8=39601)+AND(\$E\$3:\$E\$8=39601)+AND(\$G\$3:\$G\$8=39601)))

## How Can I Correct This Time Formula

Nov 4, 2005

How can I correct this Time formula which says in the Tag that it produces a
negative Result and hence displays in cell as ####

=(INDEX(\$A18:\$A33,MATCH(MIN(C18:C33),C18:C33,0)))-(60/1440)

What I am doing is selecting the field in A which equates to the lowest
value in C (C= hourly sales), then I am subtracting 60 mins from the value
selected in A. This in effect will give me my closing Times i.e. find the
cell with Zero Sales then subtract 1 hour to find what must be the closing
time (assuming of course that there is at least ?1 of sales per hour while
open).

My cells in A are formatted as h:mm AM/PM, as is the format in the formula
cell

## Stop Formula Column Reference Changing On Insert But Not Row Reference

Mar 6, 2008

A 'Days Attended' cell (N8) and a 'Days Absent' cell (O8). N8 needs to count the number of "Present" values there are on another worksheet. The other worksheet has dates across the top and names down the side.

When i use
=COUNTIF("Attendance!C9:Z9", "Present"),
and the next date comes along the formula changes to
=COUNTIF("Attendance!D9:AA9", "Present")

ie. the reference moves a column across - the new date's absent or present is not counted. Using =COUNTIF(INDIRECT("Attendance!C9:Z9"), "Present"). is no good because when i add a new name i need the row reference to move down as a row is inserted. ie. both person's formulas count the same row. So, my question: I need the columns to stay the same - C:Z (leyway for future dates) and the rows to change as i insert or delete people from the system.

## Correct Formula Related To Dates?

Aug 5, 2014

correct formula related to dates;

Assume cell A1 contains a date in DD-MMM-YYYY format. I would like to have a formula that looks in A1 and compares to the current date (TODAYS Date) and if the value in A1 is todays date or greater return "YES" and if not return "No".

## Correct Formula Not Giving Results?

Feb 25, 2014

Cell A3 on my SHEET1 has the following formula =DATE(YEAR(C1),MONTH(C1) + 1,DAY(C1). It goes on like this for the next 12 months (+2, +3, +4....).

Column B on my SHEET2 has One of the five product codes (A, B, C, D, E) and Column D on my SHEET2 has manually entered dates

I created the following condition for each product code under each month in SHEET1

=IF(MONTH(Sheet2!\$D\$1:\$D\$39)=MONTH(Sheet1!\$A\$3),COUNTIF(SHEET2!\$B\$2:\$B\$39,"=A"),"")

The formula only works for two product codes (A and B), and then yields blank cells.