I've got a xlsx file with 21 tabs at the bottom arranged as follows:
Index, V1, V2, V3, V4..... up to V20
In the index column
A1: ='V1'!C$1
A2: ='V2'!C$1
A3: ='V3'!C$1
How can I programmatically increase the value that refers to the tab by 1 each time. I need to do this for a lot of spreadsheets so don't want to manually edit the cell each time.
So something like this:
A1 ='V1'!C$1
A2 = (Value from A1 ['V1'+1])!C$1
A3 = (Value from A2 ['V2'+1])!C$1
etc
etc
You can use INDIRECT function.
=INDIRECT("'V" & ROW() & "'!C$1")
Drag/copy down formula as required.
See image for reference:
INDIRECT function returns the reference specified by a text string.
Related
I need to extract this from the cell
For example:
A1 : abode abcd=1000seconds long=50cm
I need only 1000. With this sequence and this formula I can extract 1000 from the cell.
The formula I use is MID(A1, SEARCH(“=“,A1) + LEN(“=“), SEARCH(“seconds”,A1)-SEARCH(“=“,A1)-LEN(“=“))+0
However when the sequence of cell become:
A1 : long=50cmabode abcd=1000seconds
The 1000 cannot be extracted.
Please help
Edit, since OP mentioned they are using Excel 2016, formula changed accordingly
• Formula used in cell D2
=SUBSTITUTE(FILTERXML("<m><b>"&SUBSTITUTE(SUBSTITUTE(B2,"="," ")," ","</b><b>")&"</b></m>","//b[contains(., 'seconds')]"),"seconds","")
Alternative Approach,
• Formula used in cell C2
=SUM(IFERROR(--TEXTAFTER(TEXTBEFORE(B2,"seconds"),"=",{1,2}),0))
Giving static numerical values to the ROW() formula like ROW($1:$2)) works perfectly (obviously), but I have both the values it requires in cells... Here what I am trying to build : ROW($C3:$E4)). This works, but gives me the value 3 (C3 cells's row).
What should I do in order to get the value inside C3 cell to pass it to ROW()?
For Excel 365:
If we enter:
=ROW(7:13)
in D1, we get:
Now if G1 contains 7 and G2 contains 13, then:
=ROW(INDIRECT(G1 & ":" & G2))
will give us the same result:
Don't use a volatile INDIRECT set-up when there exists a non-volatile alternative:
=ROW(INDEX(A:A,G1):INDEX(A:A,G2))
which is volatile only at workbook open.
I count the number of Excel entries within a date with the following formula (ZÄHLENWENN = COUNTIF)
=ZÄHLENWENN('2021'!L:L;">=01.11.2021")-ZÄHLENWENN('2021'!L:L;">30.11.2021")
The Formula here is working but since I don't want to enter the date values for every month of the year I have created a calculation with the function end of the month. (MONATSENDE)
How do I have to rebuild the formula when I get the two dates from two cells?
Cockpit E3: =MONATSENDE(D3;-1)+1 -> shows 01.11.2021
Cockpit F3: =MONATSENDE(D3;0) -> shows 30.11.2021
Cockpit D3: =01.11.2021 (the only one entered manually)
Unfortunately the outcome of my new formula is 0:
=ZÄHLENWENN('2021'!L:L;">=Cockpit!E3")-ZÄHLENWENN('2021'!L:L;">Cockpit!F3")
What did i do wrong ?
Greetings
You have to put E3 and F3 as references to the formula - not as a string:
=ZÄHLENWENN('2021'!L:L;">=" & Cockpit!E3)-ZÄHLENWENN('2021'!L:L;">" & Cockpit!F3)
Tip: apply a name to E3 and F3 (e.g. FirstOfMonth, EndOfMonth) and then use the names within the formula. It then gets more "readable" - also for someone else who might maintain the project later.
=ZÄHLENWENN('2021'!L:L;">=" & FirstOfMonth)-ZÄHLENWENN('2021'!L:L;">" & EndOfMonth)
And maybe you should consider using tables for sheet 2021 (Einfügen > Tabelle)
In a Google Sheet, I would like to enter a number in a cell and have certain functions in that sheet use that number.
So if cell "A1" has the value 2 assigned to it I want a function to use =C+(the value in cell A1), which is 2. So the function displays the value of C2. When changing the number in cell A1 to 5, my function should change to C5 as well . Any recommendations?
It seems to be the same as Excel. I tested it.
=INDIRECT("C" & VALUE(A1))
or
=INDIRECT("C"&A1) which is simpler (thanks Nirk)
Possible duplicate: Dynamic cell access
I have two excel sheets. The first contains a formula for calculation with one input cell (A1), and one output cell (B1). The formula for B1 could be B1 = A1 * 3 (example).
The second sheet contains various values in column A: A1 = 4; A2 = 9; A3 = 5 ... In corresponding column B of this sheet I'd like to get the result of B1 (first sheet) = A1 (second sheet) * 3 for each A (second sheet) input value.
Basically I'd like to treat the first sheet as a function, where A1 is the argument and B1 the result that is passed back to the second sheet's B column.
Sheet 2
A1 4 B1 12 (result from sheet 1)
A2 9 B2 27 (result from sheet 1)
...
Is it possible without macros?
This is built into Excel. In version 2003, use the Data, Table menu.
You can find many examples on the net. Here is one.
You can create such tables with either 1 or 2 entries (parameters).
I don't think so .....
If in B1 Sheet1 you have
3*A1
If you try this in Sheet2 B1
`=SUBSTITUTE(Sheet1!$B$1,"A1",A1)`
it will give
3*4, and Sheet2 B2 will be
3*9etc
But I don't see how you could coerce this to a numberic calculation with formulae without possibly some heavy duty formula string parsing to separate numbers from operators (which is unlikley to flex as desired if you change the entry in B1 Sheet 1)
[Update 2: but fwiw I have done it with a named range]
I used this range name
RngTest
=EVALUATE(3*INDIRECT("rc[-1]",FALSE))
This is a global range name so it will work on any sheet, more powerful than my prior OFFSET effort. It multiplies the cell to the immediate left by 3
so entering =RngTest in B1:B3 (and then in this new example C1:C3 as well)
gives the output you want
I think you want to use this in your sheet two column.
Sheet1!B1 * Sheet2!A1
Entirely without VBA: expect lots of pain, I won't go there. But...
To substantially reduce the amount of pain, you could actually use this one tiny VBA user-defined function (not technically a "macro"), basically just a wrapper to make VBA's Evaluate function available in worksheet formulas:
Function eval(myFormula As String)
eval = Application.Evaluate(myFormula)
End Function
You could then use it like this in cell B1 on sheet 2:
=eval(SUBSTITUTE(Sheet1!$B$1,"A1","A"&ROW()))
Note that this requires Sheet 1 cell B1 to contain A1*3 and not =A1*3, i.e. no equal sign. Maybe with a bit more fiddling around, it can be made to work even with the = sign there...
EDIT: Actually, if you format Sheet 1 cell B1 as Text before typing in the formula, this will work even if your formula starts with a =.
Is it possible without macros?
Yes!
You can now use =LAMBDA for this.
Define your function using the name manager, then reference it in your second sheet's formula.
See syntax at Introducing the LAMBDA function.
For more information about how to use the LAMBDA function, see the support documentation.