Excel multiple if function - excel

I am facing the following issue, at the moment.
I would like to know if a value matches with a field. This field contains the following information:
9/4/2015 12:00:00 PM
Month/Day/Year hh:mm:ss
Now I want to compare my values with the field mentioned above.
My values are: Day and Month.
My idea is to create one term and just change the values in the term
every month (for the report).
e.g.
IF Month = 10 and Day = 27 write Yes in a field. If not write No.
The problem is that a day or a month can have either two or one number:
9/4/2015 12:00:00 PM
10/25/2015 12:00:00 PM
1/12/2015 12:00:00 PM
12/1/2015 12:00:00 PM
Any ideas?
Thanks in advance.

The following forumula would do it without using VBA, comparing the value in A1 to a specific day and month using IF and SUMPRODUCT:
=IF(SUMPRODUCT(--(MONTH(A1)=10);--(DAY(A1)=27));"Yes";"No")

Related

How to Calculate difference between hours when the cells contain date in date format? And there are some conditions too

Need difference between Created & Closed In Hours along with below
The TAT hour to be calculated between 9:00 am to 09:00 pm which is working hours, if created time us 09 pm then it should be considered from next day 9 am.
Sunday is Holiday
I have tried:- =Created-Closed Date, but don't know how to exclude Sunday and calculate only shift hours.
Yes! Finally Self Got Answer For it.
Here is that
=(NETWORKDAYS(A2,B2)-1)*("21:00:00"-"09:00:00")
+IF(NETWORKDAYS(B2,B2),MEDIAN(MOD(B2,1),"21:00:00","09:00:00"),"21:00:00")
-MEDIAN(NETWORKDAYS(A2,A2)*MOD(A2,1),"21:00:00","09:00:00")

How to automatically convert a date to a specific text string?

I need to automatically convert in Excel a date to a specific string based on month and year.
Date to be converted ........... String to be changed to:
30-12-2018 06:00:00 PM ..... 12-December 18
29-12-2018 06:00:00 PM ..... 12-December 18
28-12-2018 06:00:00 PM ..... 12-December 18
30-11-2018 06:00:00 PM ..... 11-November 18
29-11-2018 06:00:00 PM ..... 11-November 18
Presented dates are provided for example purposes.
Do you know any solution to make this automatic?
I have already tried creating a separate sheet in the workbook where I manually wrote the association between the date and the string. Then I used VLOOKUP to bring the string to the area where I want to change the date.
But I want to send this report to end users and I don't want them to need to add new dates each time. Rather I want the file to update itself if possible.
In the cell formatting settings, you can use the custom date format string dd-mmmm yy for this. In my opinion, though, you'd be better off setting the cell's format to display dates according to the user's system settings.
I'm also assuming here that 30-12-2018 06:00:00 PM is a representation of a valid date value in Excel, rather than a free-text string. If not, then your actual problem is parsing this value as a date rather than displaying it in another format.

Set 00:00 as the last timestamp in Excel

I have a feed of 30 minutes meter readings from MySQL to Excel sorted by the first column which is a datetime format, i.e 10-06-2015 00:00:00, 10-06-2015 00:30:00, 10-06-2015 01:00:00 etc.
Because the reading from 00:00:00 each day is actually data from the last 30 minutes of the day, I need the 00:00:00 reading to be the last row for the day rather than the first (as Excel is sorting by time order 00:00 is the default start of each day). Does anyone know how to format this in Excel so that the 10-06-2015 00:00:00 will come after the 10-06-2015 11:30:00 row and not after the 09-06-2015 11:30:00 row?
I don't think you are going to find a way to do that using just formats. Reason being that the format doesn't change the underlying value, which is what excel uses to do the sort in the first place.
I would suggest using a helper column in which you use a formula... maybe something like this:
=IF(A2-ROUNDDOWN(A2,0)=0,A2+0.99999,A2)
Where the first value of your time series is in A1... then copy the formula down and sort on the column B. This worked for me.

I need to add 3 hours to a date + a time

I have a column where each cell has a date and a time in it
4/12/14 8:35 PM
I want to add 3 hours to the time for each cell.
In the end, it will be: 4/12/14 11:35 PM
What's the quickest way to do this?
consider =A1+3/24 -– simoco
use cell formatting to display full date and time -- nazim

Removing time element of Long Date Format

I have a list of data within the last three years, but all the dates have different times on it. I am trying to write a macro that will delete all the times. I tried changing the format of the cell but it didn't work.
EX. the list looks like:
10/12/2011 08:41 PM Eastern Time
10/12/2011 08:41 PM Eastern Time
10/12/2011 08:41 PM Eastern Time
10/12/2011 08:41 PM Eastern Time
10/12/2011 08:41 PM Eastern Time
10/12/2011 08:41 PM Eastern Time
10/12/2011 08:41 PM Eastern Time
10/12/2011 08:41 PM Eastern Time
And I need to delete the 08:41 PM Eastern Time or equivalent from each. All the times are different though. Any thoughts?
If actually date format, try =INT(A1) then format to suit.
This should cover either text or time format:
=IF(CELL("type",A1)="l",LEFT(A1,FIND(" ",A1)),INT(A1))
or even:
=TEXT(IF(CELL("type",A1)="l",LEFT(A1,FIND(" ",A1)),INT(A1)),"mm/dd/yyyy")
if the output is to be formatted mm/dd/yyyy.
If the field is an excel date and not plain text, you can use the trunc function. It should trim the time portion off.
=TRUNC(A1)
Why not simply:
=Left(A1,10)
Assuming all dates look the same (mm/dd/yyyy) format
Just in case it isn't always the first ten characters (examples: 1/1/2011 or 3/14/12), you can use this formula. Be sure to format the cell as date:
=--LEFT(A1,FIND(" ",A1)-1)
Not sure why this is not mentioned in any of the answers as its by far the fastest and easiest way to do this. You can use the DATEVALUE to convert the dates from text to an excel date if they are not already in an excel date format.
Once the date is in a number format (eg 42753.597534 which excel recognizes as January 18, 2017 2:20:27 PM): Excel equates dates to numbers and 1 is equivalent to 24 hours(1 day), while anything less than 1 is used for time. You can use ROUNDDOWN(A1,0) which will strip any non-integer part of the date which implicitly gets rid of the time (turning the above number into 42753 or January 18 , 2017.

Resources