Last Day of Previous month based on cell date given in excel - excel

Last Day of Previous month based on cell date given in excel , example used A1 cell as 6/23/2016 …. Have applied formula in b1 cell '=EOMONTH(A1,-1) … output am getting in number format could you please help to get date format here ? Any formula which helps apart from this ? Much appreciated with your responses

The format is applied as follows:

Subtract the day-of-month from whatever date you have.
=a1-day(a1)
Excel tries to carry the primary formatting from the precedent cells in a formula but sometimes it cannot so it defaults to a general number. EOMONTH is often the latter; simple subtraction seems to work.

Related

Excel date conversion to day of the week: not working after 1 row

I want to get days of the month corresponding to each particular dates in a column in Excel (Note that I am using the web version of office Excel).
The formula =TEXT(A2,"dddd") works correctly for the first row and then when applied to the later rows does not perform as needed. It returns the same date and not the weekday. I have checked the format of the cells, and it is all sent to General.
See the attached image for reference, the formula worked in C2, and not after that.
Note: I have inserted a table for the required range.
Not Recognizing d/m/yyyy
For cell A2 you can use this formula instead (in cell C2):
d/m/yyyy (Your Case)
=TEXT(DATE(VALUE(RIGHT(A2,LEN(A2)-FIND("/",A2,4))),VALUE(MID(A2,FIND("/",A2)+1,FIND("/",A2,4)-FIND("/",A2)-1)),VALUE(LEFT(A2,FIND("/",A2)-1))),"dddd")
m/d/yyyy (Someone else might need this.)
=TEXT(DATE(VALUE(RIGHT(A2,LEN(A2)-FIND("/",A2,4))),VALUE(LEFT(A2,FIND("/",A2)-1)),VALUE(MID(A2,FIND("/",A2)+1,FIND("/",A2,4)-FIND("/",A2)-1))),"dddd")

COUNTIFS in Google Sheets

I am trying to create a countifs formula that counts cancellation dates of clients by month, but the condition I want to also implement is not to count if the cancellation date was today's date (which is input in cell B1 at the top of the document).
So, for the november row, i have the formula =ArrayFormula(countif(month(H4:H89),11)) which works to count every cancellation date that happened in the month of november, but I want to add a condition that says, "but don't count if date =B1 enter code here where B1 contains that day's date.
I've tried converting the conditions in the array formula to a countifs formula but it never seems to work. Please help!
Use COUNTIFS:
=ArrayFormula(COUNTIFS(A2:A,"<>"&B2,MONTH(A2:A),11))

Highlighting A Row Based On Current Date

I have a spreadsheet in which each row of column F has a specific date. I want the sheet to highlight the row which corresponds to the current date (today). Anyone knows how to do this?
You can use the conditional formatting formula:
=$F1=Today()
and apply to the range, say,
=$A$1:$F$10
Note: Using TODAY() means that when you open the sheet tomorrow, or any other day, it's going to see if the cell is equal to that day. To make it literally today, you can do:
=$F1=DATE(2018,01,25)

Incorrect calculations? Excel not performing correct time calculations

I'm simply trying to find the number of hours between the two dates and times, but excel won't account the date to the number of hours, and only calculates the 'hours' themselves.
Your format on cell B3 is wrong. You may have mistakenly copied the date format from the cells above to B3.
If you set your format to "General" on cell B3 and change the formula to
=ABS(B1-B2)*24
I think you'll get the result you're looking for.

How to check date format in Excel

I have around 20,000 records in an Excel file and around four columns which have dates. I am trying to insert those into SQL. However date columns have dates in incorrect format eg; 02/092015 or 02/90/2015 or 2015. So checking 20,000 records one by one would be very lengthy.
I tried to count / but it didn't work. It changes the format of column to date.
I was looking for some formula which can check the format and maybe color the cell or something like it.
I was running across this issue today, and would like to add on to what nekomatic started.
Before we begin, the TEXT formula needs to follow the date format we are working with. If your dates are in month/day/year format, then your second argument for the TEXT formula would be "mm/dd/yyyy". If it is in the format day/month/year, then the formula would need to use "dd/mm/yyyy". For the purposes of my answer here, I am going to have my dates in month/day/year format.
Now, let's assume that cell A1 contains the value 12/1/2015, cell A2 contains the value monkey, and cell A3 contains the value 2015. Further, let's assume our minimum acceptable date is December 1st, 2000.
In column B, we will enter the formula
=IF(ISERROR(DATEVALUE(TEXT(A1,"mm/dd/yyyy"))),"not a date",IF(A1 >=DATEVALUE(TEXT("01/01/2000","mm/dd/yyyy")),A1,"not a valid date"))
The above formula will validate correct dates, test against non-date values, incomplete dates, and date values outside of an acceptable minimal value.
Our results in column B should then show 12/1/2015, not a date, and not a valid date.
Two of the examples you give are text which may be identified with Conditional Formatting by applying a formula rule such as:
=ISTEXT(A1)
and colouring the result as you wish. There would be an issue if all your dates (even those of valid format) are also text but I'm guessing that is not the case.
For the third example (ie 2015) a CF formula rule such as:
=AND(A1<2500,A1>0)
may help.
If your columns are a mixture of what should be dates and other entries that are properly text strings your approach may be better than the more general ISTEXT, for example a CF formula rule of:
=FIND("/",A1)>0
If you can add a column to the Excel sheet with the formula
=DATEVALUE(TEXT(A1,"dd/mm/yyyy"))
this should return #VALUE if the contents of A1 are not a valid date in dd/mm/yyyy format. You can filter on this value to identify the incorrect records.
Edit: If A1 contains only 2015 this formula returns 07/07/1905 (if the formula cell is formatted as date) so you can spot these by filtering for dates before the earliest correct date your file should contain.

Resources