Change cell when INDIRECT formula is dragged down - excel

I have the following formula set-up: =INDIRECT("'Passed to Salesforce (digital only)'!A46",TRUE)
However I'd like the A46 number to update when I drag the formula down.
I've tried using the &CELL but can't get it to quite work:
=INDIRECT("'Passed to Salesforce (digital only)'!A46""!"&CELL("address",TRUE))
Can anyone help me out?
Thanks,
Sam

I have no idea what you're trying to do in your second formula.
The first one won't change the reference because it is just text not an actual cell reference. If you only want to update the row, not the column you could use ROW() to get the current cell's row add an offset (e.g. if you start with your formula in row 1 and want A46 your offset is 45):
=INDIRECT("'Sheet1'!A"&ROW()+45,TRUE)

I figured this out, I had to remove the first cell reference and duplicate exclamation mark:
=INDIRECT("'Passed to Salesforce (digital only)'!"&CELL("address", A47))

Related

Creating a cell that updates to new value using multiple factors

I was wondering if it is possible to create a formula that updates a cell that needs to update based on both numbers and letters or would I need to create a code in VBA. What I need now is for the following values to update when the information is entered in to a designated cell:
If AA0 is entered in cell A1, then AA1 should populate in cell A2, (I would like to use AA0 all the way through AA9, and then go to AB0, which would then go to AC0 when AB9 is entered, and then if AZ9 is entered go to BA0 (I am hoping I am making since) when any of those values are entered in the cell. I had tremendous help on here before for a similar question but this involves all three digits/numbers in the cell as a determining factor and I am struggling with a formula for it. Thank you all in advance for any assistance.
Edited to add: Everything would just be entered into one cell. So if someone entered in A1 BC4, A2 would update to BC5. I wouldn't need a running list, this is to keep track of what the previous value used was.
Edit 2 adding photos for clarity:
If you always start at AA0 put this in the first cell and copy down:
=LEFT(ADDRESS(1,INT((ROW(1:1)-1)/10)+27,4),2)&MOD(ROW(1:1)-1,10)
If you want the start to be dynamic then put this in A2 and copy down:
=IF(AND(MID(A1,2,1) = "Z",RIGHT(A1)="9"),CHAR(CODE(LEFT(A1))+1),LEFT(A1))&IF(AND(MID(A1,2,1) = "Z",RIGHT(A1)="9"),"A",IF(RIGHT(A1)="9",CHAR(CODE(MID(A1,2,1))+1),MID(A1,2,1)))&IF(RIGHT(A1)="9","0",RIGHT(A1)+1)

Distribute the value of a cell over multiple cells untill the remaining value is 0

I'm looking for a solution to automatically distribute the value of a cell (C3 till C10) based on the number of months (B7 till B10).
Anyone who can help me out with this formula?
First, you can make a helper row as showed in image attached starting with number 1.
Then apply below formula to cell(E5) and drag across the range.
Formula: "=IF($B5>=E$3,$C5/$B5,0)"
Related Image
Thanks
Abhinav
Type the following formula into cell E7:
= IF(COLUMN()-COLUMN($E7)+1<=$B7,$C7/$B7,0)
Then drag this cell over and then down as far as you need it.
For second part, to calculate amount of months you can add formula in cell("C4") as:
=MONTH(DATEVALUE(C3&"1"))-MONTH(C2)+1

VBA to shift formula reference down one row

I'm currently working on a massive file, that compares year/year data.
Every week I need to update a formula in the file to move down a row. I want to make a command button to update these formulas.
Here is a simple example
cell c800 contains: =((C235-C229)/C229)*100
I would like to click the button to make the cell update to
=((C236-C330)/C330)*100
Can anyone help me out here? is this possible? I've been looking all over for this and can't find anything.
thanks
Enter this formula in C800 and it will always capture any newly added lines of data.
=(INDEX(C5:C799,MATCH(1E+99,C5:C779,1))-INDEX(C5:C799,MATCH(1E+99,C5:C779,1)-6))/INDEX(C5:C799,MATCH(1E+99,C5:C779,1)-6)*100
assumes first data point is in C5. Change as needed
This works because MATCH(1E+99,C5:C799,-1) finds the last numerical value in the column.
there is a function to do that, as if the cell containing the formula was copied somewhere else and the cell references in the formula were shifted/moved:
strFormulaMoved$ = Application.ConvertFormula(Application.ConvertFormula(Selection.Formula, XlReferenceStyle.xlA1, XlReferenceStyle.xlR1C1, , Range("C800")), XlReferenceStyle.xlR1C1, XlReferenceStyle.xlA1, , Range("C800").Offset(1, 0))

How do I increment just one number in a formula?

How do I increment just one number in a formula?
Here is my formula
=LOOKUP(C1-1,B3:B365,D3:D365).
I want to drag the formula along the row so that just the one number increases by one increment for each cell accross.
So the next cell would read
=LOOKUP(C1-2,B3:B365,D3:D365).
Here is a little abuse that will do what you need:
=LOOKUP($C$1-ROW(1:1),$B$3:$B$365,$D$3:$D$365)
assuming you are dragging down.
If you would drag to the right, you would have to substitute ROW(1:1) by COLUMN(A:A)
You can fix rows like this:
...,B$3:B$365,D$3:D$365
Thanks for all you help guys, but the formula requirements changed, but I managed to find out how to do what I needed to do in the end.
I used another cell reference form the row above the formula to increment the part of the formula that required it.
I needed to develop it further though so that the #N/A's were ignored.
The formula eneded up as --->
=IFERROR(LOOKUP($C$1-B371,$B$3:$B$365,$D$3:$D$365),"")
Thanks for all your suggestions though. I find these support communities veru useful and will use them a lot more often in the future.

trying to expand vlookup to other cells without automatically changing values

I am setting up a vlookup to pull product prices from another sheet within the workbook. The code works for the cell but when i try to expand or copy and past the code into the next row it automatically changes the data table_array value.
=VLOOKUP(B5,Prices!1:65536,3)
Within the code i want the first value, B5 to scale with the row it is in, however the second value needs to remain the same. How do i go about doing this? Also is there a way that i can get the cell to remain blank instead of displaying N/A if there isnt a valid part number?
Thanks for your help!
=VLOOKUP(B5,Prices!$1:$65536,3)
The $ lock the range.
For example.
$A1 will lock the column to A when the formulas is copied other
locations.
A$1 will lock the row
$A$1 will lock both the column and the row.
I can't comment because I do not have enough rep but this will fix user3716271 's formula:
=IF(ISERROR(VLOOKUP(B5,Prices!$1:$65536,3)),"", VLOOKUP(B5,Prices!$1:$65536,3))
The following formula should solve both problems as well, a little more compact and would use one less VLOOKUP():
=IFERROR(VLOOKUP(B5,Prices!$1:$65536,3), "")
As guitarthrower had said, the $ before the number is used to lock the range.
For the second part, an IF formula will work fine:
=IF(ISERROR(VLOOKUP(B5,Prices!1:65536,3)),"",VLOOKUP(B5,Prices!1:65536,3)),"")
And if I understand correctly the first part have you tried set an absolute value? Something like:
=IF(ISERROR(VLOOKUP(B$5,Prices!1:65536,3)),"",VLOOKUP(B5,Prices!1:65536,3)),"")

Resources