prevent value from changing once formula is applied - excel

I have the following formula in my activity sheet in the date column
=IF(ISBLANK(A1),"",TODAY())
This is to automatically populate the cell with the current date if A1 is not empty, i have applied this formula to all the cells in column A. But everyday i open the sheet to add my activities the previous days date value automatically changes to the current date, Is there any way to lock the cells value from changing once the formula is applied for the first time or is there an alternate way

Copy the field and inset as value in to the same . This way, the formula gets replaced with the value and never changes.
Otherwise let the formula reference to a static field which has the date in it.

Assuming the formula is in B1:
With iterative calculation (options > formulas > check "enable iterative calculation") you can use this formula:
=IF(A1="","",IF(B1="",TODAY(),B1))
if anything is in A1 then B2 will show the actual date but if B1 alredy has a value, it shows the old one (open it up days later will still show the old date) but empty out A1 to reset and a new entry will show the actual date again (just switching the value wont work, you need to empty A1 to get the actual date)

Related

How can I automatically formulate a column while adding values ​to another? EXCEL

I have a column formulated in excel that returns all the business days from date X to today and it is automatically filled in, and there is a column to its right in which a COUNTIF formula is applied based on this first column , but the cells are not filled automatically as it happened before, but you have to drag down to complete the formulas, and I want this to be automatic too.
The first column is fulfilled with the following formula: =WORKDAY(MIN(Data\[Fecha_Completa\]-1);SEQUENCE(NETWORKDAYS(MIN(Data\[Fecha_Completa\]-1);MAX(Data\[Fecha_Completa\]-1)))), and the second one (which doesn´t fulfill automatically): =IF(COUNTIFS(Data\[Fecha_Completa\];A2)=0;A2;""); in which it is explained that, if the date of the first column is found in the database (Data[fechacompleta]), I want excel to return me nothing, but if it isn´t found, I want excel to return me the same date. Then the problem is that the second column isn´t fulfilled automatically at the same time as the first does.
As you may appreciate in the first image, the formula exists for that value, but once more dates are included in the database (as you may see in the second picture when we come to February) formula stop working and obliges me to drag it down.
I have tried to applicate the formula to the whole column but that isn´t what we are looking for as the file would be heavier.
To base a formula on a dynamically-spilled array, use a # in your range references. Therefore using A2# instead of A2 will automatically spill the formula to the same size as the formula in A2.
=IF(COUNTIFS(Data\[Fecha_Completa\];A2#)=0;A2#;"")

Why is this excel formula not evaluating properly

I have created a spreadsheet with a section for each day that is broken into half hour segments (as pictured). I am trying to build a formula that can be dragged down and return the date at the top of each daily section (I am ultimately planning to use this formula as part of a conditional formatting rule)
The formula that I have entered in C4 should return the date shown in C2 but it is actually returning the value of C3. If I highlight the part of the offset formula that refers to the row 0-(B4-"0700")*48 and force it to evaluate using F9, it evaluates as -2. If I then explicitly enter -2 into the row parameter of the formula it returns the correct value in C2
Is there any reason the formula is returning the wrong value?

Conditional formatting is not working for less than TODAY(), only for greater than

Conditional formatting does not apply to dates less than TODAY(), only greater than TODAY().
I have an IF statement with two VLOOKUPS inside. One of them outputs "Not Registered" if the cell looked is empty. The other, just copy the data that is on the other spreadsheet.
=IF(VLOOKUP($A5,Table,#MATCH(D$3,Headings,0))=0,"Not
Registered",VLOOKUP($A5,Table,#MATCH(D$3,Headings,0)))
Conditional formatting is set to:
cell values >= TODAY() are green
cell values < TODAY() are red
cell values = "Not Registered" are yellow
I suspect the conditional formatting is not reading properly the date. Every date cell is formatted as long date.
The problem comes up because A3 is empty.
Change the rules to use =Today() or populate A3 with the desired date.
Edit 1: If this is not working for you, check the data type of cells that should be red. If these are not real dates (but text), then they will never meet the condition. Make sure that all cells that look like dates actually contain dates (and not text).
If the lookup table stores the dates as text, then you can make the changes there, because the Vlookup will return the same data type.
Edit 2: Selecting a cell and changing its format will NOT convert text to a date. You can test if a date is really a date by changing its format to General. If this results in the cell showing a number, then it's a real date. But if the cell appearance does not change, the value is text and you need a different approach.
One option would be to use a helper column with a formula like =DateValue(A1). Copy the helper cells and paste them as values over the original cells, then format as date.
Or, put a zero into any cell, copy the cell, then select all cells that may or may not be dates and use Paste Special > tick "Add" > OK. That will convert dates stored as text back to their internal storage number. Then format the cells as dates.
Or, do the conversion after the Vlookup by wrapping a DateValue around the VLookup formula.
=DATEVALUE(VLOOKUP("a",A1:B1,2,0))
The "date" in B1 is really text. The Vlookup returns it as text, but the DateValue() then converts it to a date. If this one throws an error, the date text does not agree with your regional settings of what a date is expected to look like.
Reason:
Whenever the cell go past by the Less than today rule, computer will read that as zero so it will return true because zero is less than today.
Solution:
On the Conditional Formatting Rules Manager,try to enable the Stop if true for the not registered rule.

Linking entered dates to column location

I have a spreadsheet with the following format. I was given this spreadsheet to use so I'm not sure what use these formulas for dates have in opposition to normal text.
Along the first 4 rows of each column:
K2: 2017 [=TEXT(K$5,"yyyy")]
K3: April[=TEXT(K$5,"mmmm")]
K4: Wed [=TEXT(K$5,"ddd")]
K5: 05 [=J5+1]
In another sheet, I want to do:
=Sum(K6:N6)
=Sum(K7:N7)
At the start of every week I have to change the columns to the dates of that week
=Sum(O6:S6)
=Sum(O7:S7)
Instead of manually entering the range of columns each week for the 40 rows that I have, Is there a way I can type in the date, or the column in a separate cell and use that as the object of the formula so I only have to enter a start column and end column/or date and the list will all update?
Not sure about the whole picture, but the answer to your question is yes, you can have a special cell (or several cells) where you can keep some parameters.
In order to use the value from such cell in a formula you have to specify it with the "$" characters, this way the address of the cell will not change when you copy/move the formulas around.
So, say, you want the parameter to be in cell A2 - in the formulas you have to use "$A$2".
Another way is to use named ranges. You can assign a name to a cell or range of cells. THe simplest way to do so is to select the cell you want to hold the parameter (let's say it's A2 again) and then click into the box leftmost to the formula bar (where A2 is displayed) and type there a name you'd like to use, for example "STARTDATE" and press Enter. You have just named your cell. Now in a formula you can use STARTDATE instead of cell address, which is even better, because you can use a meaningful name and the formulas will be easier to understand.

Conditional formatting: automatically refer to the next cell?

I have a schedule with team member names and the column headers are half hour time intervals. I want to shade the cells of hours each person does not work with gray according to their shift schedule, so that I know not to schedule that person during that hour.
I have created a separate table with each person's shift schedule, and the names appear in the same order as in the schedule.
Is there any way to conditionally format the cells at once? There has to be an easier way then what I am doing now...which is one by one clicking on each person's cell and creating the formatting formula.
I can't copy paste the formatting because the formula still refers to the previous person's shift on the other table. I need it to refer to the next row.
The formula I use for conditional formatting is:
='Job Functions'!$O$5>$C$9
Where Job Functions is the sheet that contains the shifts, O5 is the shift assigned to that employee, and C9 is the column header on the schedule (6:30am). I just clicked on the cell and created a new conditional formatting rule from the excel ribbon on top...no vba.
If there is a VBAsolution to this that'd be great! I'm fairly new to VBA
Conditional formatting works like this
Let's say I have an array of numbers in A2:E5 and a header row in A1:E1. I want to have my array of number be green if the value of the cell is greater than it's column header. That is to say I want to compare A2>A1, B5>B1, D4>D1, etc. this means I want the header row comparison to be constant.
In Excel formulas you use the $ symbol to maintain constant references. Since I want the row to stay constant but I want the column to be relative to the cell in my array of numbers my header reference will be A$1 (column is relative, row is locked).
This is just the formula used to determine if formatting will be applied or not. If it returns true then the conditional formatting is applied, if it returns false then nothing happens.
However, where the formatting is applied is determined by the Applies to reference. In my example below I am applying the formula A$1<A2 to $A$2:$E$5. This means that in the cell A2 the formula A$1<A2 is used to determine if formatting is applied, but in B3 the formula B$1<B3 is applied. This is the same logic as if you were to have dragged the formula itself into these cells.
If instead my Applies to formula were $B$2:$E$5 this means that B2 would be colored green if A$1<A2, and B3 would be colored green if A$1<A3.
So with all that your formula should probably be
='Job Functions'!O5>C$9
drag and drop it down to fill the other cells

Resources