I have in cel A1 with the following contents:
7:30:43
which is a time.
But now i want to use a formula to add one hour. What is the best way or how can i do this?
=A1+TIME(1,0,0)
Although, maybe this should be posted on Super User.
In cell A1, enter the time.
In cell B2, enter =A1+1/24
This may help you as well. This is a conditional statement that will fill the cell with a default date if it is empty but will subtract one hour if it is a valid date/time and put it into the cell.
=IF((Sheet1!C4)="",DATE(1999,1,1),Sheet1!C4-TIME(1,0,0))
You can also substitute TIME with DATE to add or subtract a date or time.
Related
Basically, I'm having a table where A1 shows the status (active / inactive). C1 has a date and when that date comes (lets say it's tomorrow), the value of A1 should change from active to inactive. Can someone please help out with this one. I tried playing around with =INDEX formula but can't get it to work. Thanks in advance.
try this formula:
=IF(C1>TODAY(),"Inactive","Active")
Use an if() statement like so:
=if(C1<now(),"Active","Inactive")
You may need to check the formatting of C1 or the cell with the date.
enter image description herei would like some help in trying to create a formula that compares a certain time in 1 cell to the Current time.in the end, i would like that cell to highlight a color if it is less then or equal to then the current time.
For example:
Cell A2 has a time of 14:00, highlight this cell Red if it is less then or equal too than the Current time.
You can just enter the formula =TEXT(NOW(),"H:MM") and then just do a conditional format as formula to say, cell C4<=A2 or what ever cell ref you have.
The NOW formula will return Todays date and the current time. The text formula allows you to remove the date, and display the time how you want it. "H:MM" will still return military time. If you want to go to standard use "H:MM AM/PM".
UPDATE: Try using the below format for the cell, and in the conditional formatting formula =($H$9<=(NOW()-TODAY()))
This should match up your formatting with the now function.
As for wanting to be able to just type in the time without having to hit the colon. The only way I know how to do that is cell format as Other and 00:00. However this is not a time format and it messes with the conditional formatting. So you will need to find a work around
I need to convert this data dd/mmm - 31.mar (March) to this format 31/03 - dd/mm using excel formula
A bit of googling would have solved your issue here.
Select cell (or range of cells).
Right click with mouse
Format Cells
Custom
Change Type: dd/mmm to dd/mm
=text([CellWithDate],"dd/mm")
is the formula you want, I think.
#Valeria:
Can't be sure I understood your problem and/or the type of solution you're looking for.
I assume you have a date in , say, cell A1 and that cell is showing the date in "dd-mmm" format.
I also assume you want that date to be shown in another cell (different from A1) in "dd/mm" format BUT without previously setting that target cell format to "dd/mm".
In case I'm right, the formula you should put in the target cell shouldo look like:
=DAY(A1) & IF(MONTH(A1)<10;"/0";"/") & MONTH((A1))
This way, if cell A1 holds "31-aug", you're getting "31/08" wherever you put that formula.
The value Excel actually stores in the cell is just its date+time serial number (whatever you're seeing is a very different question). DAY() and MONTH() do work on that value to generate day of the month and month of the year after that serial number.
Hope this helps.
I need help with a formula.
I have a spreadsheet where the user enters an integer in one cell. i need to use that value to place a formula in another cell.
so, for example, user enters 24 in the cell. I need it to place a simple sum formula in the 24th cell of the row immediately to the left and highlight it red.
is there any way to do this?
You would put the SUM formula in an IF() function that is true when the row = the value in the cell:
=IF(ROW()=$E$2,$E$3-SUM($B$1:$B1),"")
OFFSET may be a great option here.
If I understand what you are saying, based on your comment to #ScottCraner's answer, you can use this formula in say P4 or wherever really.
=P3-SUM(OFFSET(P4,0,0,P3,1)
This will work if you do not need the formula to be exactly in the cell P28 or wherever it's defined, but just want to SUM the number of payments based on the trigger in P3.
I need to write a formula in Excel that returns a numerical value in B1 for a day of the week entered in A1. For example:
A1=Sun so B1=0;
A1=Mon so B1=1;
A1=Tues so B1=2; etc.
I've set up a drop-down in A1 to keep the data consistent. I tried writing a nest IF and OR function in B1, but can't seem to make it work.
Any suggestions?
Please try:
=MATCH(A1,{"Sun","Mon","Tues","Wed","Thu","Fri","Sat"},0)-1
I would setup a lookup table (maybe where you dropdown data is) and use vlookup
=VLOOKUP(A1,Dates!$A$1:$B$3,2)
Type this code into cell B1.
=LOOKUP(A1,{"Sun","Mon","Tues","Wed","Thurs","Fri","Sat";0,1,2,3,4,5,6})
Then you can copy it down the column as needed.