Changing reference cell in a function - excel-formula

So, this is my formula: =IF(E137="013";C105+1;"")
I want to change C105 cell to cell when the "if" formula is true for the first time and later over and over again. Basically make C105 a variable. Is there a way without using VBA?
Thanks!

Related

Check for specific formula (no VBA)

Is it possible to check if cell formula is a specific formula, and not just "isformula" ?
My example:
In cell A1 I have, normally, "=B2".
But during the use of this sheet the formula might be overwritten to "=D4".
How can I get a simple TRUE result if the formula in cell A1 is "=D4", and FALSE if it's something else ?
I get fix it with VBA but I prefer to use standard formulas first (if it's possible obviously).
Thanks for your time.
Using FORMULATEXT:
=FORMULATEXT(A1)="=D4"

Excel - Self reference a cell in conditional formatting

I am trying to create a conditional format formula to colour a cell based on the value of itself, the cell next to it on the right, and whether the cell on the first row in the same column is a weekday or not.
Currently it works correctly as follows:
=AND($A$2=0,$B$2=0,WEEKDAY($A$1)<>1,WEEKDAY($A$1)<>7)
I have a lot of cells I'd like to use this formula in, so I thought about creating a cover-all formula that used the ADDRESS function.
My original idea was to use:
=AND((ADDRESS(ROW(), COLUMN()))=0,$B$2=0,WEEKDAY($A$1)<>1,WEEKDAY($A$1)<>7)
(I've changed just one cell reference here for example, but I'd like to change all 4 if possible).
However, when I try to use ADDRESS(ROW(), COLUMN()) in place of an absolute cell reference, the formula doesn't format the cell anymore.
Is there a way to make this cover-all formula work so that I don't have to go through and change the referenced cell values each time for every cell? Am I missing something about the syntax? Or will this simply not work the way I'd like it to? Thanks in advance!
ADDRESS returns a string that looks like a cell address and "$A$2"<>0.Wrap the ADDRESS in INDIRECT or rewrite your original without absolute rows.
=AND(indirect(ADDRESS(ROW(), COLUMN()))=0, indirect(ADDRESS(ROW(), COLUMN()+1))=0, WEEKDAY($A$1)<>1, WEEKDAY($A$1)<>7)
=AND($A2=0, $B2=0, WEEKDAY($A$1, 2)<6)

How can I use a formula with an IF function?

I'm wanting to check for blank cells, and when the cell is not blank, output a formula. However, I am getting errors and I believe you're not allowed to use formulas within an IF function, are you guys able to help me out?
=IF(A1="","",=lastModified(A1))
If the cell is not empty, this formula will return the date the cell was last modified. I do not want the date updated if the cell is blank.
Thanks for the help.
If you want to call the formula, just remove the equals sign. It will call when the FALSE condition triggers in your IF statement.
=IF(A1="","",lastModified(A1))

Output result of formula on different cell without VBA

Is it possible to output the result of a formula on a different cell without the use of VBA and without directly reffering to the cell containing the formula (e.g. writting =C1 into the output cell)?
I know that this can be easily done with the help of VBA, but I was wondering if there really is no simpler way to achieve this.
I don't think so, if you dont want VBA then all I can think of is to lock the cells so they can't be updated.
How to lock just a range of cells
As far as I know all formulas display their results within the cell they occupy.
if you want to pull a value from a cell without directly referencing the cell address, you could indirectly by using the offset function. However even the offset function needs to reference at least one cell on the worksheet.

function or syntax to copy/reference a cell value instead of a cell formula

I would like to insert in a cell the value calculated by a formula in another sheet.
If I use the something like =MySheet!MyCell Excel adds a reference to that cell and by doing that it actually re-use that formula.
As only option I know I can use "Paste Value" to copy the value from that source cell to my destination cell.
Is there any Excel function to just copy the value or do I have to implement a function/marco myself?
In Excel function or VBA function you can only make reference to the cells. To "Paste Value" you have to write VBA sub.
What you want to do is Paste Values. you can do that either directly (you already mentioned it), or in VBA. Use
<your range>.PasteSpecial xlPasteValues
within any code you want.
Note that you cannot write a Function to return the value pasted as value. This is tantamount to removing the formula which generated the value. The only way to perform that action do it is via a Sub, not as the result of a Function which returns a value.

Resources