MS excel : Freeze the current date value using a NON VBA approach - excel

VBA can turn over Excel anyway you want .SO pl understand this question is NOT the duplicate of a similar question that asks how to get it done using VBA.
I would like to assign the current date to a cell and PRESERVE that value
That means after opening the file a few days , on the value should NOT change How do I get this done using a NON VBA formula based approach
a1=Date()
but the date value does not change.
Thank you both. You both rock. But stack will not let you do > 1
Both answers are practicable but given the reqs, I had - I just wanted to
'dirty stick in' the date wherever I want without scratching around .
The 1st answer is useful if you have a conditional logic 1 col
update should get a date in ,the other column. The 2nd one does the
quick stick of the date.

I don't see the problem. If you want a static date in a cell, just click on the cell and enter something like:
2/11/2016
The date will not change unless you change it.
If you are not certain of the current date, then click on the cell and touch:
Ctrl + ;

Like said many times at this side:
Goto options -> formulas -> enable iterative calculation
Then in A1:
=IF(A2="","",IF(A1="",NOW(),A1))
If you put anything in A2 then A1 will become the actual date/time and stay with this value as long as A2 is not empty... it will not change in later calculations ;)
You can try this with the actual formula (showing also time including seconds) it will not change. If you empty out A2 and reinsert something, it will jump to the new time and then stay with that value as long as you want (even close/open will not change that)

Related

Deleting cell data when it is a specific date

If A1 contained the number 5 and A2 contain the date 7/1/23 when we reached the date of 7/1/23 I want to delete the number 5 in cell A1. Can anyone assist with a simple formula for this? Thank you!
Hey there!
What you want to do within the same cell as the value 5 may require some more skilled coding that allows the cell to hold data and a formula that updates itself. However I can recommend another way that achieves what you want but also retains some history.
The left set is what your result would look like if the date is older than todays date. The right being if todays date has not reached the date you specified.
Before row contains the points that would currently exist, while after would contain the points after the date affects the "drop off" you would like.
Then an If statement just compares whether todays date is older/same/or newer than the target date. (To make this formula more dynamic, you can replace B5 with "today()")
=IF(B5>=B3,"",B1)
or
=IF(TODAY()>=B3,"",B1)
Hope this helps!
What it should look like:

How do I copy a cell in Excel?

I know this is a simple question, but, what I mean is how do you copy a cell, but when that cell changes, it doesn't affect the copy.
To make it a bit easier to understand, If I had A1 that said "Hi", and I wanted A2to say "Hi" also, I would put =A1. However, if I changed A1, it would change A2 along with it, and that is what I don't want.
I am asking this as I have a formula that says that something is so and so weeks overdue, but when a checkbox is ticked, the weeks counter stops and doesn't add any more.
Here is what I mean and the paragraph underneath states what it means and what I need from it.
The cell that says "13/02/2019" is =TODAY() and the cell that says "06/02/2019" is a date I manually entered. The problem I have is that if I came back in 1 week, it would say "Handed in late by 2 weeks." and that is what I want to prevent. However, I only want this =TODAY() to freeze when that check box is ticked.
Today() reports today's date and it will always update to the current date. Today() is a volatile function that will recalculate on every worksheet change, even cells entirely unrelated to the function. Formulas referencing a cell containing Today() will also update to reflect the current date like you are experiencing now.
You appear to be looking for a process that will snapshot the date at the time of an action (checking a box). If you want it to be a formula, you will need to input the date of return as well and create a formula comparing the difference between to two inputs. There is already a shortcut to insert today's date in a non-formula method: Select the cell and press Control + ; (semi-colon). A simple formula that references the difference between the check-out and check-in dates on a per line basis with rounding and concatenate functions, should accomplish the described purpose.
A1 = (Checkout date)
B1 = (Return Date)
C1 =IF(ROUNDUP((B1-A1)/7,0)=1,CONCATENATE(ROUNDUP((B1-A1)/7,0)," Week"),CONCATENATE(ROUNDUP((B1-A1)/7,0)," Weeks"))
This function checks the difference between A and B, divides by 7 to get number of weeks, rounds it up to a whole number, and checks if the number of weeks is 1 or not. If it is one the text will say " week" otherwise it will say " weeks". This also avoids using a volatile function which in larger projects would cause incessant and potentially resource demanding calculating.

Excel force date to NOT change

The spreadsheet I am working on involves well over 100 cells, each with (possibly unique) dates, however for simplicity we will say that I have just 2 cells to work with, A1 and B1.
In A1 I want to enter data (could be text, or a number) ONE time...let's say on Monday.
I want to use something like an "IF" statement in B1:
(If A1 > "" then B1 = date (of data entry)
I want this date to be static (non-changing); in other words, I don't want that date to update on next Friday when I open the file to work in it again.
"Now" always updates. "Today" always updates. I do not want the date to keep changing to the current date, and I don't want to enter a date in the associated cell every time I enter data.
I'm really not sure this is possible using the standard Excel functions, but maybe someone else has an idea...? I've considered using VBA, but I'm not sure that's the best way to go either. TIA!
From Google:
Insert a static date or time into an Excel cell:
On a worksheet, select the cell into which you want to insert the current date or time.
Do one of the following: To insert the current date, press Ctrl+; (semi-colon). To insert the current time, press Ctrl+Shift+; (semi-colon).

Using the 'TODAY' function

My spreadsheet is to show me how many days active a certain field has been.
For this I am trying to find a formula which will automatically take the entered date from one cell and deduct it from "todays" date.
As an example I have used =DATEVALUE("22/04/2017")-TODAY() - and although this works, i am unable to drag the formula down into other cells, to auto populate when a date has been entered/ amended. I'm having to enter the formula above every time, and if the date changes, as an example from the 22/04/2017 to the 20/04/2017, I would have to manually amend the formula too. How can I get it just pick up the date in that particular cell and deduct "today" from it?
Sorry if i'm rambling, I just don't know if I'm explaining myself properly.
Thank you
Typically, 'how many days active a certain field has been' would be a positive number (i.e. the number of days). Reverse the subtrahend and minuend to get a positive integer like this,
=today()-a3
To avoid getting 5/15/2017 or 42,870 as the result when A3 is blank, check to see if there is something in A3 before attempting subtraction.
=if(len(a3), today()-a3, text(,))

number formatting is changed erroneously to time/date

I have a spreadsheet with numerous formats, mostly time and whole number. Data validation is present to assure proper formats. certain fields can be selected and VBA programmatically inserts the system time to the selected cell. This works perfectly and is very helpful when using this sheet. The problem occurs if a cell that should have a whole number (and definitely not a time) is accidently selected, then the "enter system time" code is run. This changes the format of that cell to time/date. said in another way, A1 is formatted for Number, 0 decimal places. A1 is selected and the "Enter system time" macro is run. The macro is not affected by the data validation rule that would otherwise prohibit anything but a whole number between 1 and 999. Now that the formatting is changed by VBA (somehow), when you enter, say, 5 into that (formerly) number-formatted cell, displayed is 1/5/1900 0:00. Because this is a compiled workbook, the change is permanent; the cell format cannot be changed back.
so, my question is: Is there a workaround? Is there a way to prevent this sort of format change? is there a way to unlock the cell if the format is wrong? Is there any sort of suggested method to avoid this?
You can check if the format is a number with 0 decimal places using the NumberFormat property of the Range object like:
If Range("A1").NumberFormat = "0" Then
'Some Code
End If
Check https://msdn.microsoft.com/pt-br/library/office/ff196401.aspx for more information on formats
Finally got this. The correct number formatting command is:
If Selection.NumberFormat = "[$-409]h:mm AM/PM;#" Then...

Resources