I'm struggling with a problem here. I'm sure it's so simples, that's why I can't find the answer.
I need to apply this to Sheet1!C4:C22:
=(RANDBETWEEN(1.45*100,1.95*100)/100)+Sheet2!C12
Problem is: I've tried Fill tool && select the range Sheet1!C4:C22, paste the formula in the bar and hit ctrl+enter but here lies the problem: excel keeps changing the cell on the formula, as it goes down the column. I don't want that! How can I stop it doing that without copy paste by hand? I know it's not a lot of columns, but it's handy.
P.S: Sheet2!C12 contains a fixed value of 0.056.
If you want to use a constant range when dragging a formula down then add $ dollar signs before the letter and number
example
Sheet1!$C$12
Related
I want to create a tab that will display all the cell values of another tab based on the tab name provided on a cell.
I have played around with the indirect function, but I cannot write a formula so that by dragging down and right it will access the cells.
=INDIRECT("'"&$A$1&"'!A1")
This part &$A$1& is getting the name of the tab.
If I drag down this formula, the last A1 does not change though.
You can use the formula ="Sheet2!A1" in Sheet1 Cell A1 and drag down, then across. I tried to find a faster way to paste it into every cell, but I had to force quit the application because it used all of my available memory. You might think about whether you actually need every cell to be duplicated into the second sheet. Good luck!
Edit: Just realized you were dead set on using Indirect. This should work.
=INDIRECT("'Sheet2'!"&CELL("address",A1))
Simply use following formula
=INDIRECT($A$1&"!A" & ROW(1:1))
Try building the string like this. The final A1 will work as you want it to.
=INDIRECT(CONCATENATE("'",$A$1,"'!", CELL("address",A1)))
I have an excel formula across a column for which the base changes every "x" number of rows. Note this "x" is not constant and keeps changing. e.g.
=D1/SUM(D$1:D$4)
=D2/SUM(D$1:D$4)
=D3/SUM(D$1:D$4)
=D4/SUM(D$1:D$4)
=D5/SUM(D$5:D$9)
=D6/SUM(D$5:D$9)
=D7/SUM(D$5:D$9)
=D8/SUM(D$5:D$9)
=D9/SUM(D$5:D$9)
I am trying to change the first part of the formulas without changing the second and vice versa. e.g. changing the numerator by 10 cells.
=D11/SUM(D$1:D$4)
=D12/SUM(D$1:D$4)
=D13/SUM(D$1:D$4)
=D14/SUM(D$1:D$4)
=D15/SUM(D$5:D$9)
=D16/SUM(D$5:D$9)
=D17/SUM(D$5:D$9)
=D18/SUM(D$5:D$9)
=D19/SUM(D$5:D$9)
or, changing the base by 100. e.g.
=D1/SUM(D$100:D$104)
=D2/SUM(D$100:D$104)
=D3/SUM(D$100:D$104)
=D4/SUM(D$100:D$104)
=D5/SUM(D$105:D$109)
=D6/SUM(D$105:D$109)
=D7/SUM(D$105:D$109)
=D8/SUM(D$105:D$109)
=D9/SUM(D$105:D$109)
Sometimes, both. Any guidance on how this can be possible?
Thank you.
the first part of this problem seems easy unless I am missing something?
Part 1:
Since the denominator is already in $x form, you can select and COPY the whole range of formulas and PASTE them 10 rows down and then CUT and paste it back into position. The COPY will update the numerators appropriately and when you CUT and PASTE it back into position they will now be just as you want? The second question will be a bit more of a challenge!
Part 2:
OK without VBA I can only think of a really long-winded way to change your demoninators, but I just checked that it does work:
To change the bottom.
Search and replace = with '=
Now you can edit the formulas more freely.
Search and replace D with D%
Search and replace D%$ with D
Search and replace D% with D$
get rid of the '= by using the Data>text to columns option
Now use the copy and paste, cut paste trick from part 1.
Then if you still need your $s back as they were you essentially repeat 1 to 5 again.
Sorry, this looks really long-winded, but if you are desperate and back up before you start it should work.
An excel formula can't replace another cells excel formula... One approach is to make the formula into text and then transform it by other formulas. When transformation is done, you could paste the formula back.
So for changing the D1 -> D11, I would build a dummy series (column K) then write a formula (cell L1). Then I can copy the formula and paste it into the correct column.
Replaceing the "=", with a special character and then you can transform the formulas.
(Column F).
In Column I, the formula used is: =RIGHT(F1,LEN(F1)-FIND("/",F1))
For changing D$1 -> D$100, I think I just would copy and replace it by searching in "Formulas".
This approach can be feasible for acouple of hundred cells. If the list is very long, I would recommend some VBA solution, where you can grab a cells formula with .Range("A1").Formula
I would like to fill A000001, A000002, till A100000.
Now do it by dragging the fill handle.
I also tried to fill using Step Value and Stop Value. It works for 1,2,3 to 100000. But it does not work for alphanumeric filling like A000001, A000002 etc
Use the step value method to generate 1 to 100000 in column A (from cell A1). And paste the below formula in cell B1,
=IF(LEN(A1)=1,"A00000"&A1,IF(LEN(A1)=2,"A0000"&A1,IF(LEN(A1)=3,"A000"&A1,IF(LEN(A1)=4,"A00"&A1,IF(LEN(A1)=5,"A0"&A1,IF(LEN(A1)=6,"A"&A1))))))
Just double click the fill handle in B1 to generate for the entire range. This is a simpler way of doing this. Hope this helps.
The standard method is Create custom list but since you are looking for a long one so practically impossible,, another is Flash Fill,, and older one is write A000001 in cell A000002 in below cell select both drag it till you need.
I know its too late, however I can provide a tip it may be helpful to someone looking for same issue.
if you want fill the alpha numeric series by dragging the fill handle, just need to add a simple formula in the first row:
="A"&TEXT(ROWS($1:1),"000000")
In the above formula: the text “A” is constant, you can change them to your needed text, and the number “000000” is the variable which will be increased by dragging the fill handle.
Also if you want to add a string at end , you just need to change the formula to this,
="A"&TEXT(ROWS($1:1),"000000")&"-VAL"
Then it will give you something like this,
A000001-VAL, A000002-VAL, A000003-VAL.....
You can also change the starting number too.
Regards
I am trying to prep some zip codes to go into the WHERE clause of a SQL query:
WHERE [Zip_code] IN ()
To do this I put all the values into Excel and want to concatenate the zip codes with an apostrophe at the beginning and an apostrophe, a comma, and a space at the end so 99508 would become '99508', . So I wrote the equation
=Concatenate("'",D2,"', ") where D2 is the zipcode. It worked for the top row producing '99058', but when I filled down it still showed the value for D2
To make matters more confusing, when I click on the cells and see the formulas, they are tracking the proper cells but still show data for the top row
I have tried everything that I can think of to solve the problem: reformatting everything as text, formatting the zipcodes as Numbers rather than text, putting the text in the adjoining columns (C2 has an apostrophe, D2 has the Zip code, E2 has apostrophe, comma, and space) and concatenating, using & instead of concatenate ("'"&D2&"', " ), concatenating A on the front and B on the end to do a find and replace, but I still get the same result. If I select a concatenated cell, click on the formula bar, and press enter the cell shows the proper concatenation, but I would rather not do that for every single cell.
My co-worker suggests including that the zip codes were taken from pivot table outputs.
Any suggestions?
Turns out that calculations had somehow been set to manual instead of automatic.
Switching back to automatic solved the problem.
use this instead
=concatenate("'";D2;"',")
idk if gonna work on you sheet, bc i have in spanish my MS-office suite
but if doesn't work, replace the ; for ,
if you copy the formula to the other cells, this must change to the next row
First is clear the worksheet format
secondly, click on file on the excel, then to option, to formula after formula, check the position of the calculation. if its in automatic change it back to Manual and then change it back to automatic. That will solve it.
I want to change a variable in an excel formula horizontally and maintain one variable constant.
O3/$C18, P3/$C18, Q3/$C18
I can keep the the bottom variable constant by using the $ symbol but when I want to extend the formula to additional cells, the top variable does not change horizontally, rather vertically.
Thank you for your help. Cheers
The dollar signs in excel "fix" the item to their right
$C18
means C will always be fixed, and 18 can change
C$18 means C can change, but 18 is always fixed.
$C$18 means C is fixed and 18 is fixed (ie always use C18 no matter what direction you drag the cell)
I dont fully understand what you want to do but hopefully the above will help
based on the comments below i think i understand what you mean
try a formula like this
=INDIRECT(ADDRESS(1,ROW()))/$C$18
here address takes the row and column, so row = 1 and column = which ever row you are on (so row1 = A, row2=B etc)
then indirect lets you use that as a reference point
Hope that works
If I understand you correctly, you want to copy your formula vertically, but have the columns update as if you were copying horizontally. For example, you want to copy =O3 to the cell below it as =P3.
For the top, consider the Offset() and Row() functions. Let's say that Cells A1,B1,C1 are 1,2, and 3. Try =OFFSET($A$1,0,ROW()-1). If you copy that formula vertically, the result will be 1, then 2, then 3.
So in your case, try =OFFSET($O$3,0,ROW()-1). It probably needs a little adjustment.
Here's another way to do this:
Start with the formula in this form:
=O$3/$P$18
Copy and paste it across so that you get:
=O$3/$P$18 =P$3/$P$18 =Q$3/$P$18
Copy the two formulas you pasted and select the cell below the first formula.
Then do a Paste Special / Transpose, which can be accessed by right-clicking the selected cell (that is, the one below the first formula that you entered) and then choosing the button that shows a little two-cell range flat and then upright.
Finish up by deleting the formulas in the cells you just copied from.