Offset Based On Division Of 2 Cells
Apr 23, 2008
I want to use offset in a macro based on a callvalue. for example I have
200 in 'A1'
25 in 'B1'
current selected cell is 'C1'. I want to go 8 (200/25) cells down. something like offset(A1/B1,0).
View 3 Replies
ADVERTISEMENT
Sep 6, 2013
1) I am trying to find a matching value in a table. I have a 5*252 table that starts in B2. So the table goes from B2 to F253. I am trying to match a value in column D (column 3 in the table and column 4 in the spreadsheet) with a value in Column F (column 5 in the table and column 6 in the spreadsheet). The original value is in cell 222 in the table and cell 224 in the spreadsheet.
I tried the LOOKUP, VLOOKUP and HLOOKUP functions, but they return nothing but N/A. I use a reference cell or just the value for the lookup value but it does not work. I do not know if I am using the wrong formulas or what, but I have tried various permutations. (question 3 in excel workbook )
2) I am trying to calculate the standard deviation of a column D (contains both numbers and text) divided by column B (first in table). Excel does not appear to have a custom division formula. It has a remainder and a quotient formula which does not apply here. The problem is that the STDEV function does not allow for a division sign (/) in the formula. the STDEV function does ignore texts.
Is there a way for me to divide a cell ( containing both letters and numbers) by another cell just containing numbers and then taking the standard deviation of those values all in one formula?
View 1 Replies
View Related
Apr 15, 2014
I am working on a macro and this section has me stumped. The worksheet columns are A:AE. Occasionally, the procedure needs to select a varying number of cells in a row which don't always fall in the same column, count the number of cells in the selection and then paste the data on the row above it, in column ("AE" minus the Selection Count).
Here is what I have so far:
[Code] .....
The red-bold bracketed code is the syntax I'm not able to figure out how to phrase.
View 11 Replies
View Related
Mar 3, 2014
I am trying to paste data into cells that are offset from specific data in my excel sheet.
The code I've got so far is:
[Code] ....
What I am aiming for is to search my Columns G and H that contain the values 1 & 1. Then from the cells that contain those variables, move 2 row up and 7 columns to the left and then paste on that active cell.
I am completely new to VBA so im sure there plenty wrong with this VBA script but so far ive managed to paste the data but it just pastes across the whole row instead of just the cells ive copied.. now i just get errors on the script.
View 5 Replies
View Related
Dec 21, 2008
I know there is a way to divide by 0 in Excel and get 0 (or NA) but can not remember how to do it. Help. (Is there a problem with printing the resutls?)
View 9 Replies
View Related
Dec 15, 2009
When I debug this script I get: division by zero!
In 3 lines over the debugging line, the script are writing out the variable "prosentref" as 1. Whatt can be wrong?
(the value in cell T8769 is 1)
Option Explicit
Sub optimaliseringDrift()
Dim Pgm1 As Integer
Dim Pgm2 As Integer
Dim PL As Integer
Dim lamda_gm1 As Double
Dim lamda_gm2 As Double
Dim deriv1 As Double
Dim deriv2 As Double
Const Pgm1_max As Integer = 200
Const Pgm2_max As Integer = 300
Const Pgm1_min As Integer = 45
Const Pgm2_min As Integer = 40
Const deltaP As Integer = 5
View 9 Replies
View Related
Aug 7, 2007
I have a column where I am dividing 2 values in 2 different cells in 2 other columns. Obviously, wherever there is a zero in the denominator, the result is '# div/0!'. How can I get these to just be zero in these cases?
View 8 Replies
View Related
Nov 9, 2009
In the attached file I am simply trying to get a percentage for a given group based on the column "annual starts". When I try and copy down the formula for the other cells it gives me an error because its using the wrong denominator (the errors show up in the excel sheet as #div/0).How can I make this consistent?
View 2 Replies
View Related
Jul 4, 2013
I am puzzled with the following formula (entered with CTRL+SHIFT+ENTER) and it will not work. I get a error due to division by 0
{=SUM((MONTH(A$1:A$25)={1,2,3,11,12})*B$1:B$25)/SUM(MONTH(A$1:A$25)={1,2,3,11,12})}
My intention is to simply get an average of the values in column B if its respective row in column A is month # 1,2,3,11, or 12
A
B
1
01/15/2013
100
[Code] ......
Refer to the above table. Since A1, A2, A5, and A6 are having the months I seek, I then need Excel to use the values in B1,B2,B5, and B6 to offer me the average. In this case it should be (100+200+500+600)=1400 then divided by the number of occurrences column A had months that matched my criteria=4... so the final answer i would need is 1400/4 = 350
View 5 Replies
View Related
Aug 16, 2007
I'm trying to get the % increase but when its goes from 0 to "xx value", I get the division by zero error.
For example:
2006 Sales: 0
2007 Sales: 10,000
It would show the correct % increase in sales.
View 9 Replies
View Related
Dec 3, 2006
I have a forecast for a week, all days I type in, the real order, in the end of the week I got a difference between the forecast and the real orders. the difference can be positive or negative, in any case I want that difference to be added on the next cell on next week, plus the difference between the forecast and the real order from the day before, and so on.
I'm using this formula "E4*($L$3+1+IF(K4,ABS(K3/K4-1),0))" but if the real order is less than the forecast the formula add the difference increasing in a positive way, when what I want is decrease the value if the difference shows a negative tendency.
hope this make sense.
I attached a file with what I intend to do.
View 9 Replies
View Related
Jul 26, 2007
I work in a finance dept and we often need to divide our numbers into 12 months but I need to only work with whole numbers, not decimals. Is there a way for example of forcing either in a formula or with VBA code to get 10,000 to divide equally by 12 months? At the moment it comes out at 833.333333. What I want is something that randomly assigns 833 to any one of the 11 months of the year and for the other remaining month put in the difference which is 837 to get the total to add up to 10,000exactly.
View 9 Replies
View Related
Aug 1, 2006
I have this formula. I'd liked the entire referenced amount(s) to be divided by 2. Nothing I tried worked.
= SUMIF( 'X'!$B$1:$B$3000;'Z'!$B34;'X'!$F$1:$F$3000)/7,6+(SUMIF('X'!$B$1:$B$3000;'Z'!$B34;'X'!$G$1:$G$3000)/7,6)+SUMIF('Y'!$B$1:$B$3000;'Z'!$B34;'Y'!$F$1:$F$3000)/7,6+(SUMIF('Y'!$B$1:$B$3000;'Z'!$B34;'Y'!$G$1:$G$3000)/7,6)
View 2 Replies
View Related
Jul 26, 2007
I work in a finance dept and we often need to divide our numbers into 12 months but I need to only work with whole numbers, not decimals. Is there a way for example of forcing either in a formula or with VBA code to get 10,000 to divide equally by 12 months? At the moment it comes out at 833.333333. What I want is something that randomly assigns 833 to any one of the 11 months of the year and for the other remaining month put in the difference which is 837 to get the total to add up to 10,000exactly.
View 9 Replies
View Related
Nov 11, 2008
I need a slight mod to the below code which works perfectly otherwise. What it does is it divides whatever is in column K by 30 and puts in its relative cell in column M( There a bunch of mini tables below each other with blank rows in between).
The thing is sometimes there are characters in column K like "N/A" for instance and the macro crashes since its only designed to take into account numerical and blank cells in column K.
View 6 Replies
View Related
Jul 31, 2012
let say i have in Sheet1 colomn A a list of names, i want to select the names and copy them to a second sheet (Sheet2) base on the below criteria
in Sheet2 the first name should be in B3 and second name in E3 the third name in B23 the fourth name in E23 the fifth name in B43 and so on .
View 9 Replies
View Related
May 24, 2012
I'm looking for a formula that will take the cells used as a heading and place them cell into columns with the corresponding rows under the heading.
I'm thinking that the formula will have an offset that counts the blank cells in column A then place the text from the heading cells (by heading cells I mean the ones that say "Type A" and "Code X") next to the rows with the products.
Maybe a VBA script? What do you think?
View 7 Replies
View Related
Sep 9, 2009
how to make offset for the cells to the row -3 in colum B
View 9 Replies
View Related
May 11, 2006
I am trying to write a loop that will look at every instance of a specific item in a column eg. "2x6 spruce" then sum the cells in the next column (which gives the lineal feet of "2x6 spruce" required) .
View 4 Replies
View Related
May 8, 2014
I have three columns of Data. A is vehicle number, B is miles and C is a Date. I want to be able to pull the miles for the newest date when the user types in a bus number next to the formula. I think It can be done with an array formula but I am not 100% sure on how to do it. Also is it possible if they enter a vehicle number and a date that a different formula finds the miles for the most recent date to the date entered.
Excel Help.JPG
View 6 Replies
View Related
May 20, 2008
I want to have a variable range.
ie. This value M4 needs to change based on the week.
Range("M4").Select
If it's week 1, then it can be say M4, but week two will need data to go to N4.
I have found out how to get the week number from the user. ie.
' Select Week Number
Dim NumSheets As Integer
Dim Prompt As String
Dim Caption As String
Dim DefValue As Integer
Prompt = "What week do you want to get data for?"
Caption = "Week Number"
DefValue = 1
NumSheets = Val(InputBox(Prompt, Caption, DefValue))
If NumSheets > 52 Then MsgBox "Week Number too high"
If NumSheets < 1 Then MsgBox "Week Number too low"
I tried then linking this value saved as NumSheets by:
Dim Rng As Range
If NumSheets = 1 Then Rng = Range("D3")
If NumSheets = 2 Then Rng = Range("E3")
View 3 Replies
View Related
Aug 20, 2014
I want to be able to have a range selected and copy the cells offset it it at (0,-2),(0, -4) and (0,-7) all at the same the to reduce the macro time.
View 1 Replies
View Related
Feb 6, 2012
Essentially i'm trying to get the max of 5 cells at a time using the 'offset' reference. Here's my erroneous code:
Dim maxCell As Range
For Each maxCell In Range("y9:y150")
If maxCell.Value "" Then
maxCell.Offset(0, 1).Formula = "=max(maxCell.offset(0,-20): maxCell.offset(-5,-20))"
'maxCell.Offset(0, 1).Formula = "=max(maxCell.Offset(-5, -22) : (0, -22))"
End If
Next maxCell
I have two slightly different lines of code here (highlighted in red), one is commented, but i've been changing both to no avail.
I only want this to be triggered when the cell to the left (maxCell) is not empty, hence I use the offset feature. I've tried to use absolute references for the max formula, but then each cell has the same answer.
View 5 Replies
View Related
Feb 7, 2013
How do I offset a range of cells?
I'm running simulations. Let's say I want to run the "for" loop 100 times. In the 1st iteration I want to copy Range(A1:A10) and paste the value to A31:A40 (this destination range is fixed for each iteration). In the 2nd iteration I want to copy Range(B1:B10) and paste to (or assign value to) A31:A40. In the 3rd iteration I want to copy Range(C1:C10) and paste to (or assign value to) A31:A40. And so on for 100 iteration. So each time my copied range moves one column to the right.
How do I achieve this in VBA code? Let's say I have defined/named Range("A1") and want to keep offsetting to the right but copying 10 cells in the range as I go along.
View 6 Replies
View Related
Jan 16, 2013
We make many graphs using XYscatter charts with lots of data points using Excel 2003 with the horizontal scale properly scaled as frequency. I have been asked to label that axis in some way as period (=1/frequency) without changing the scaling for the data plot. Is there a suitable way to do this? It would be OK to just change the axis numbers to 1/frequency computed from them automatically. Is Excel 2010 any easier for this?
View 9 Replies
View Related
May 8, 2007
What I have:
I have 12 months in a year and each number represent a month. I have generated lists of data mainly interest and principle payments from 12 amortization sheets which i have just copied into the attached spreadsheet and will change accordingly based on the loan terms which doesn concern us. For our purposes we wont make distintion between principle and payment as i just need to see how to make what i need work.
What I need:
I need to offset data vertically automatically once i the user selects an option value (Number in this Case) from the validation list located within the Payment control box. Going from left to right you see the raw data but in this example i need the data on the right hand side to be offset down the number of rows which may be found in the control box as a validation list.
IE:
So if i were to use "Loan I" [L6] and select a "2"[J6] from the "Payment Control" then the data on the right hand side [L6[ would reflect a $0 but instead the new value for L7 would be "$24.96" and would continue down for about 374 rows. This will have to be done for Loans I - Loans N [L6:Q6] respectively. This is all i need in order to compile and make use of in my spreadsheets.
Thanks and cannot be a formula as forumlas will be overwritten and cannot be a macro so it must be a module in itself so it an run when the list is changed.
the single digit values in coulmns M6:Q3 are there mainly so you can see the difference between the base and the position at which the data is placed at. its not need but is there to stress and to show the number rows in offset of data.
View 9 Replies
View Related
May 31, 2014
I am having some difficulties using a combination of IF and the OFFSET function to display a range of cell values from another column based on a simple condition. The values I need to display at the destination cells should be offset by 8 columns to the right and "X" rows down from the reference column. The value "X" is to be determined via the IF function to check for the row index number.
For example, if Index value "X" = 8, then display the value of B2 in cell I9. IF X = "9", display B2 in cell I10 etc.
I have attached a sample worksheet that provides some examples.
View 3 Replies
View Related
Mar 29, 2013
I have a table that is 10 columns wide. On a separate worksheet I want to display the last 10 rows of the table - 100 cells in all.
Getting the value of one of the cells is easy enough - I used:
=OFFSET(DataTableFirstCell,COUNTA(Sheet2!$A:$A)-1,0)
If I copy/paste, or drag the fill handle to expand the target range I end up with the same formula and same value in all 100 target cells. I know I can edit each cell to modify the offset -1,-1, then -1,-2 then -1,-3 etc but that's mind-numbingly tedious and likely to introduce error.
There must be a way to have a cell reference another, then copy the formula to adjacent cells and and have the result show the content of cells adjacent to the original source.
I've been trying INDIRECT and INDEX with ROW and COLUMN - but I can't work it out.
View 9 Replies
View Related
Feb 13, 2007
i need to get an equation correct for a scheduling application
assume $f24 is a task frequency and U24 is our current cell location
=IF(OFFSET(U24,0,(-$F24+1),1,($F24-1))"","","X")
i am asking if (the range of cells to the left of current cells (range being task frequency -1 columns wide) are empty - and if so - put an x - if they are not empty - then leave it balnk.
i can get it to to work for a 2 weekly schdule but need it to work upto 52 weeks
i have a simple spreadsheet with the problem clearly defined for anyone who can help
- beer in it for anyone who can help - or can pay via paypal if required
View 9 Replies
View Related
Feb 15, 2010
I'm trying to make a simple chart with VBA based on a row with values that will color the offset cell interior red and also give it a value of 1. (look a the example sheet.)
View 4 Replies
View Related