I have the results of a survey with birthdays in various date formattings.
01.01.1990
02/03
04.05 etc.
Every time Excel sees a day and a month without a year it implies the current year and puts it in the cell without any hesitation. So, when we try to extract a year, we get not the error we expected but the current year, which is nonsense.
How can we avoid this behaviour?
The desireable result is:
One column with one formula
If the year is written, we extract it using =YEAR()
If it is absent, we just do anything else, for instanse put "".
Basic change of formatting doesn't change the implication of the current year. And if we change the format of the whole column from date to text, we cannot use the formula "YEAR" anymore to any of the cells.
This is a task for students who can deal with Excel and Google Sheets only, Python is not an option.
I would be very grateful for any help!
Both Excel and Google Sheets stores date as a number (day count) starting from 1900/01/01 so it either assumes year for you or doesn't recognize it as date at all.
If you convert date to number, 1900/01/01 will be 1, 2023/01/16 will be 44942 (as it is 44942 day counting from 1900/01/01).
I assume that survey can't be filled by people born this year so just "filter" them out:
If date is in A1 use formula:
=IF(OR(YEAR(A1)=2023,YEAR(A1)=1900),"",YEAR(A1))
This will print nothing if captured year is 2023 or 1900 (this behavior also possible when dealing with dates without years).
I am using an excel sheet which I have design looks like an excel calendar. The Outlook of this sheet is as under.
The 1 is representing the Time which I am getting from system using =time() function, while the No.2 is the date which I am getting from system using today(). I have written the formula using if for range C4:D21 which is working good. The formula is as under.
=IF(AND($C$3=K8,B4=K7),C4,IF(AND($C$3=K8,B5=K7),C5,IF(AND($C$3=K8,B6=K7),C6,IF(AND($C$3=K8,B7=K7),C7,IF(AND($C$3=K8,B8=K7),C8,IF(AND($C$3=K8,B9=K7),C9,IF(AND($C$3=K8,B10=K7),C10,IF(AND($C$3=K8,B11=K7),C11,IF(AND($C$3=K8,B12=K7),C12,IF(AND($C$3=K8,B13=K7),C13,IF(AND($C$3=K8,B14=K7),C14,IF(AND($C$3=K8,B15=K7),C15,IF(AND($C$3=K8,B16=K7),C16,IF(AND($C$3=K8,B17=K7),C17,IF(AND($C$3=K8,B18=K7),C18,IF(AND($C$3=K8,B19=K7),C19,IF(AND($C$3=K8,B20=K7),C20,IF(AND($C$3=K8,B21=K7),C21,IF(AND($D$3=K8,B4=K7),D4,IF(AND($D$3=K8,B5=K7),D5,IF(AND($D$3=K8,B6=K7),D6,IF(AND($D$3=K8,B7=K7),D7,IF(AND($D$3=K8,B8=K7),D8,IF(AND($D$3=K8,B9=K7),D9,IF(AND($D$3=K8,B10=K7),D10,IF(AND($D$3=K8,B11=K7),D11,IF(AND($D$3=K8,B12=K7),D12,IF(AND($D$3=K8,B13=K7),D13,IF(AND($D$3=K8,B14=K7),D14,IF(AND($D$3=K8,B15=K7),D15,IF(AND($D$3=K8,B16=K7),D16,IF(AND($D$3=K8,B17=K7),D17,IF(AND($D$3=K8,B18=K7),D18,IF(AND($D$3=K8,B19=K7),D19,IF(AND($D$3=K8,B20=K7),D20,IF(AND($D$3=K8,B21=K7),D21))))))))))))))))))))))))))))))))))))
This is a too long function which is only working for two columns I want to know the formula which will match the running time and date within the row date C3:I3 and time B4:B21 and then populate only concerned cell value within the K4 Cell where "False" is written. This formula is working good but I want to a shorter one. Thanks
Try below formula.
=INDEX(C4:G11,XMATCH(K7,B4:B11,-1,1),MATCH(K8,C3:G3,0))
Here XMATCH() parameter [match_mode] -1 means search next smaller time if time is not exactly same as Column B.
Is this even possible and if it is, what would be the best way to go about it?
What I'm trying to do?
I've been trying to setup a database of documents in Excel (name of document with a hyperlink to a folder structure where it is saved) along with their dates of issuing, time period for which they are valid and their expiry date - each in its own column.
For example, a date of issue for Document_001 is 21-02-2015, it is valid for one year, so its expiry date is 21-02-2016. That part is solved.
Now, these documents are certificates of a certain kind, and they are issued upon inspection completeness, which takes some time to organize and prepare. That's why in the fourth column I have a date which is 3 months before the date of expiry. So, for Document_001 that would be 21-11-2014.
Now the part which I cannot figure out; is there a way to make Excel compare the dates in this column with the current one (TODAY()) and change the colouring of the cells which are past it?
If you had the 'warning date' in cell D1 (for example), you can add the following formula in another column:
=today()-D1
If you format this cell as a number, this will give the number of days between today and the warning date. This number will be positive if today is before the warning date and negative if the warning date has passed (or zero if the warning date is today).
You can then use conditional excel formatting, and then format the cell, for example, in red if the cell value is negative. Conditional formatting is slightly different on older versions of Excel, but there is an overview here
So basically I have a main table, and I want to filter that data to another table (normally easy) but I want this based upon 2 criteria. e.g. I want to filter the data of a specific department but only for the current month. The way I display the current month in the main table is by inserting the date from a userform and then by formatting that cell to just display the month. However, when using advanced filter I use the column headings that I want to filter e.g. department: mens, month: november (worked out using =now() then formatting to just display the month) but when I'm running the filter it's not picking out the information at all.
I think this lies with the way the month is worked out and displayed but I can't figure out another way to do this. Any help is greatly appreciated.
I'm also open to trying a new method of just selecting data for the current month if anyone has a cleaner way, as I'm sure there is one.
You have to use a formula in your criteria to specify what month you want to extract. But it's not terribly intuitive. Take a look at this sample. My starting list is the range A1:B7. My criteria is in range D1:E2. The Department is straightforward; I just entered "3". (Obviously, without the quotes.) But instead of a Month criteria, I added "GetMonth" and entered the formula shown in the formula bar. You can name this whatever you want, but it can't be the same as one of the headers in your source list. (Yeah, I checked.) The formula checks to see if the current month of the date in cell B2 is 12, which is December, and returns TRUE or FALSE. You could use 11 for November. The advanced filter will apply the reference to cell B2 that's in the formula in a relative fashion to all cells in the Month column. And Viola! my output in range A10:B11 is what you'd expect it to be.