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.
Related
I am building a new dashboard that refreshes on a daily basis. The dashboard includes current month data as well as prior month data. However, I need to try a few different scenarios in terms of dates to ensure that month transitions work with no problem. For example, I would like to know what my formulas would do when it is the first day of the month, and the second day of the month with different conditions such as the 1st day being weekends or holidays, etc, where I won't have any data, which would lead to errors.
I tried fixing formulas, but there were way too many formulas involved and related to each other. Also data is being pulled from SQL server, where I am also using GETDATE().
For example, one of my formulas show
=YEAR(TODAY()-1)&IF(MONTH(TODAY()-1)<10,0&MONTH(TODAY()-1),MONTH(TODAY()-1))
to get the year & month (e.g. 201904 for 2019 April). This is one of many formulas that has today() built in
In sum, I am wondering if I can change the date that Excel is reading off. For example, I have a formula with =TODAY() - I want this formula to return some other days I set to, rather than actual date of today.
First place this user defined function in a standard module:
Public Function todaz() As Date
todaz = Evaluate("=today()") + 12
End Function
Then in your worksheet, replace all instances of:
Today()
with:
todaz()
You can change the User defined function to have any date offset you wish.
When you are done testing, change all the todaz() back into Today().
Here's a non-VBA version:
Have a cell in which you put just =Today(). In the worksheet, replace all other instances of Today() with a reference to this cell. For testing, replace the Today() with whatever date you like, and when you're done, put the Today() back in.
Both this and Gary's Student's version have the advantage of being less volatile - that is, they will run much faster because Today() is one of those functions that recalculates frequently in every place it appears -- and in your case that sounds like a lot.
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).
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(,))
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)
I am not sure if I am just over looking something, because I am still a very newbie to Excel's functions, so here comes the problem :
Lets say that I have A1 cell, and I want to display todays date in another cell whenever the A1 cell isn't empty.
So I came with this :
in another cell :
IF(A1<>"";TODAY();"")
Todays date is 16.8.2015, but when I run TODAY() through a condition like this, the output is : 42232
Why would I get this weird number ?
Maybe I did syntax wrong ? Not sure.. I also tried to make =TODAY() in new cell, that displayed the 16.8.2015, and then I wanted to show that cell through that condition, it threw the "42232" again.
Be sure that the cell format is Date and not General or Number.
The TODAY function returns a serial number which is equivalent to the amount of days since 1/1/1900. That is why you are seeing the number instead of the date.
Select the cell with the number and on the Home tab you can change the format to Date (See Below).
Every date in Excel is represented by a number. For example, the number 1 represents 1/1/1900. Whereas 42232 represents 8/16/2015.