I have 3 cells in Excel as follows:
Cell
A1=2012
A2=12
A3=15
Which contains year, month & date value respectively. And I want to make a date string out of it.
I know it's very easy to achieve using Date function.
But I also want the cell to remain blank if any of A1,A2 or A3 is blank.
something like
=IF(COUNT(A1:A3)=3,DATE(A1,A2,A3),"")
Related
I am trying to set the entire first row as duplicate-paired dates
ex: Columns A & B: today's date; Columns C & D: tomorrow's date; Columns E & F:next date and so on until the end of the year.
I used conditional formatting and Autofill with Trend but no luck..
my question is about...how to actually do it without having to manually introduce them.
=IF(MOD(COLUMN();2)=0;CELL(A1)+1;CELL(A1))
Any advice would help, thank you
to populate the date in the first row, in cells A1 and B1 use:
=TODAY()
then, in cell C1 use:
=A1 + 1
And populate towards the right for as many columns as you need
Not sure I understand where the conditional formatting comes in...
Paired Dates
Today's date is 03/07/2019 which Excel 'translates' to 43531:
=43531+INT(COLUMN()/2)-MOD(COLUMN()-1,2)
or use any number for the 'starting point'. Format the cells as date of course.
Apply to Values
Rows
=INT(A1/2)-MOD(A1-1,2)+1
Columns
=INT(A1/2)-MOD(A1-1,2)+1
I have something like
January - February ...
Whatever:
It is, each column is a month and then 1st row has the month name, 2nd row has the number of whatever attribute i want (I'm just putting an example). My idea is to put something like.. in each cell under the month: =cellSomething
and in cell something I should check from which cell I'm calling and then check the month (upper cell) and do something like =If(callerCell.upper.month < May) = 5 else 10
how could I check the caller cell or pass a cell or value to the function?
I'm not entirely sure I understand the requirement, but I would go with something like this:
Use dates rather than names for your column headers (you can then apply formulas to them and also use a custom number format to display the month name). So something like this is what you seem to be asking for:
A1: 01/01/2017
B1: =DATE(2017,MONTH(A1)+1,1)
drag this across to L1
format A1:L1 with a custom number format: mmmm
A2: =IF(MONTH(A1)<5,5,10)
drag this across to L2
We already know where the months are in the first row, so in B1 enter:
=IF(COLUMN()<5,5,10)
and copy across.
I want to highlight the row which has the today's date. I am using the condition
=$B20=TODAY()
with the format applied to the whole table, but not even a cell is highlighted (B20 is the cell which contains the content '31.1.17', and it IS a date, not text or something. The Weekday is in a separate column):
How to fix the expression? What is wrong?
Just change the formula to : =DATEDIF($B3;TODAY();"d")=0
(For the first cell of your range, so that i'll be =DATEDIF($B20;TODAY();"d")=0 for row 20)
I am using the following SUMIFS() function:
=SUMIFS(A:A, B:B, C1)
Column B:B contains dates in the following format:
2014-01-01 01:14:44
Now in cell C1 I'm not sure how to format the date so that it will grab all records that match all records that fit what's in cell C1. I have the following:
2014-01-01
but it return nothing. How do it make it so that it grabs the date, but doesn't discriminate the time portion?
You can leave C1 as a date and the data as it is - just change your formula to the following
=SUMIFS(A:A,B:B,">="&C1,B:B,"<"&C1+1)
Excel stores dates as integers, times are simply fractions of the day so every C1 date (no matter what time) falls somewhere between C1 and C1+1. This formula gets that data
The simplest way may be to keep your formula as is, other than changing C1 to D1, but insert a column immediately to the right of A with:
=INT(C1)
copied down to suit.
I am trying to use some logic in a spreadsheet without any macros.
First I have a sinle cell that gives the date and time. I then used the custom format on that cell to just show the "h". So only hour numbers 1 through 24 appear in this cell. (e.g. at 3:20 p.m. I get 15 in the cell). (Cell # A:1)
=now()
Second, I have a separate single column with 24 rows numbered 1-24 (Cell #'s B1:B24)
I have a third column that has logic that states "Night" shift" for numbers 23 & 0-6; "Day Shift" for numbers 7-14; and "Mid Shift" for numbers 15-22) (Cell #'s C1:C24)
=if($A$1=B1,"Night Shift","")
However, the third columns all appear blank even tough one should appear. I tried changing A1 using text(A1,"#") but I get the serial number. Is there an easy way to dynamically have a value in column C show what shift based off the hour of the day in cell A1. Column D simply concatenates all 24 cells since there will only be one number ever. (Cell # D1). Thanks for any help.
You could use a LOOKUP formula to return the shift based on a time/date value in A1, e.g.
=LOOKUP(HOUR(A1),{0,7,15,23;"Night","Day","Mid","Night"})&" Shift"
Changing the format of the cell containing the date and time does nothing to the actual contents of the cell. It will still contain a value such as 43706.75 (number of days and fractions of days since 1/1/1900).
If what you want to do is determine the shift for the date/time in A1, you could use a formula like:
=IF(AND(HOUR(A1)>=7,HOUR(A1)<15),"Day Shift",IF(AND(HOUR(A1)>=15,HOUR(A1)<23),"Mid Shift","Night Shift"))
And similar logic if you need to apply different multipliers for the salary.
If you need something else, be more specific.
By doing =now() without any formatting you get the Date and the Time. Then in cell A2 do
=(A1-INT(A1))*24
Then in cell A3 do
=INT(A2)
This gives you the hour number extracted from a date format so a comparison can be made in column C against the numbers in column B. Thanks.