I need to complete a large number of pivottable formula using criteria/fieldnames that are above/to left of cells. The base, static formula is as follows:
=GETPIVOTDATA("BDGT",'Pipeline PVT'!$A$6,"FiscalQuarter","FY16-Q3","AreaName","Western Europe")
I want to grab the value field (BDGT in this example) from the formula heading, which will be BDGT. But when I replace "BDGT" with a cell reference (ie: A4), I get #REF.
Any ideas why this is not working?
=GETPIVOTDATA(A4 & "",'Pipeline PVT'!$A$6,"FiscalQuarter","FY16-Q3","AreaName","Western Europe")
The & "" after A4 is the important bit...
Related
My formula is as follows:
=(CONCAT("=RSLINX|PLC1!",B3)
B3 = VarName1
The goal is to use the RSLINX function with the contents of a changing cell (B3)
I have also tried putting "=RSLINX|PLC1!" in it's own cell to reference as a string, as well as the following formula:
=INDIRECT(CONCAT("=RSLINX|PLC1",B3))
The objective is that B3 can change to a different cell (B4, B5, etc.) so that I can evaluate many different tags quickly, as the only way I've had the RSLINX function work is by manually typing in a correct tag name.
Resolved. I had to use the original formula:
=(CONCAT("=RSLINX|PLC1!",B3)
For all desired tags, then copy it and use "Paste Value" and Search & Replace all "RSLINX" with "=RSLINX" in the new columns.
I have data in following pattern:
I want a formula to get the data between Content Start and Content End. The amount of content between the start and end is not just limited to 4 and can change.
You don't say what you want to do with this result.
I am assuming you can code the column in which your data is located.
The formula below will return those values as an array. e.g. with your data, the formula will return {1;2;3;4}
The values could be numeric or text.
How you want to handle those values is up to you.
=INDEX($A:$A,N(IF(1,ROW(INDEX($A:$A,MATCH("Content Start",$A:$A,0)+1,1):INDEX($A:$A,MATCH("Content End",$A:$A,0)-1,1)))))
EDIT: Here is an example of using that information to create a sparkline. In this example, the formula above has been wrapped in TRANSPOSE and entered as an array formula in C1:I1. The Sparkline has been entered in B1. As with most charts, Excel is ignoring the #N/A errors.
And here is an example where the sparkline is in A1 and the transposed array is somewhere else, not in view, on the worksheet:
With Worksheets("Your Sheet").Range("A:A")
Set c = .Find("Content Start", LookIn:=xlValues)
Set d = .Find("Content End", LookIn:=xlValues)
ActiveSheet.Range(Cells(c.Row + 1, c.Column), Cells(d.Row - 1, c.Column)).Select
End With
Probably multiple ways doing this, but if you prefer to do it without VBA you could use:
Formula used in B1 (allthough a bit lengthy):
{=INDEX($A$1:$A$10,SMALL((ROW($A$1:$A$10)>MATCH("Content Start",$A$1:$A$10,0))*(ROW($A$1:$A$10)<MATCH("Content End",$A$1:$A$10,0))*ROW($A$1:$A$10),SUM((ROW($A$1:$A$10)>MATCH("Content Start",$A$1:$A$10,0))*(ROW($A$1:$A$10)<MATCH("Content End",$A$1:$A$10,0)))+ROW(A3)))}
Notice it's an array formula entered through CtrlShiftEnter
Drag down....
I have a value in the cell A1 that can be "PERSON, REGISTRATION,CONTRACT"
Then I have to add in the cell A2, an hyperlink to another spreadsheet:
If the value of cell A1 is PERSON go to spreadsheet2
If the value of cell A1 is REGISTRATION go to spreadsheet3
If thevalue of cell A1 isCONTRACT go to spreadsheet4
How can I do this please ?
Thank You -
Something like this:
=HYPERLINK("#'" & CHOOSE(MATCH(A3,{"person";"registration";"contract"},0),
"Sheet2","Sheet3","Sheet4" ) & "'!A1", "Go")
Edit: some explanation
MATCH(A3,{"person";"registration";"contract"},0) -finds the position of the value in A3 in the array of possible values.
Given that position, use CHOOSE() to pick the correct one from the three possible worksheet names to use in the hyperlink address.
The rest is just stringing all of that together to create the link formula.
Try this one:
=HYPERLINK("#"& LOOKUP(A1;{"contract";"person";"registration"};{"sheet4!";"sheet2!";"sheet3!"}) &"$a$1";"LINK to " & LOOKUP(A1;{"contract";"person";"registration"};{"sheet4!";"sheet2!";"sheet3!"}))
It is important the lookup_value must be in alphabetical order and you should be sort the lookup_vector accordingly.
I am using Excel 2013 at my workplace and the cell columns are numbered instead of alphabetized.
With that in mind, these are my table array values for my vlookup formula that excel automatically populated for me as I used my mouse to highlight the table area.
Sheet1!R[2]C[-3]:R[6]C[-2]
How do I lock down these values?
I tried things like
Sheet1!$R$[2]$C$[-3]:$R$[6]$C$[-2]
but it doesn't work.
This is my current vlookup formula.
=VLOOKUP(RC[-1],Sheet1!R[2]C[-3]:R[6]C[-2],2,FALSE)
Below is the table array source that I am trying to reference.
Please advise! Thank you!
ANSWER: Below is the formula I am using now:
=VLOOKUP(RC[-1],Sheet1!R4C1:R8C2,2,FALSE)
it is locked in :-)
In R1C1 notation you miss out the square brackets for absolute or include the brackets (around the number) for relative.
References:
R1C1, the unused Excel cell reference system
See discussion also here.
MSDN Address Property:
Example The following example displays four different representations
of the same cell address on Sheet1. The comments in the example are
the addresses that will be displayed in the message boxes.
Set mc = Worksheets("Sheet1").Cells(1, 1)
MsgBox mc.Address() ' $A$1
MsgBox mc.Address(RowAbsolute:=False) ' $A1
MsgBox mc.Address(ReferenceStyle:=xlR1C1) ' R1C1
MsgBox mc.Address(ReferenceStyle:=xlR1C1, _
RowAbsolute:=False, _
ColumnAbsolute:=False, _
RelativeTo:=Worksheets(1).Cells(3, 3)) ' R[-2]C[-2]
You can change back to alphabetized columns by changing this setting in Excel options:
I'm looking automatically to calculate the average of 40 values that come from a .csv file, which I have managed to do.
My problem is I would like it to take the values from any separate workbook based on the cell value from the original workbook, so this can automatically calculate the average from any one of a number of available spreadsheets.
This is the formula I'm using currently:
=Sample1.csv!C1
And this is the what I tried, which obviously doesn't work:
=B4.csv!C1
With B4 containing the word Sample1 or any other Sample Number.
The formula you can use to refer to a cell on another sheet
=INDIRECT(B1 & "!C1")
Where B1 has the sheet name and you get the value of cell C1 from it.
It can be used to get data from another workbook , so long as the other workbook is open.
eg
=INDIRECT("[Book1.xlsx]a.csv!$A$1")
=INDIRECT("[" & B1 & "]!$A$1")
Where B1 has the name of the workbook
In practise you might use:
=INDIRECT(B1 & "!" & C1)
Where C1 contains (ie stores as a value!) the address of the cell you want to reference. Thsi is useful as it allows you to copy the formulas such that the addresses change.
It is better to use the CELL function as follows which uses CELL to get the Address of A1 as text eg "$A$1". This means the formula can easily be copied and pasted into the cells you want it to be in.
=INDIRECT(B1 & "!" & CELL("address",A1)
Enjoy.
You can use the Indirect() function to have Excel interpret a text string as a cell reference, and this string can be constructed with the text values from one (or more) cells.
So in your example use:
=INDIRECT(B4 & "!C1")
which retrieves the value "Sample1" from B4 and concatenates this with the second part of the string to give "Sample1!C1" that Indirect() then uses as an address & retrieves the value from there.