Do not enter shortcut years like 18, 19, 20, etc. Excel stores date as serial numbers and displays them according to the format.Anything other than numerical values, we will get an error as #VALUE! The given number should be >0 and You only need to add your data to the Excel sheet and run the code every day you visit an office. Once the above code is written on the VBA module, save the workbook. Write the above in your VBA module and save the workbook as a macro-enabled workbook. I have already written a code to send birthday emails to everyone if there is any birthday today. So here, I have developed a code to auto-send birthday wishes.īelow is the list of employees and their birthdays. However, sending each one of them is a tedious task. There are many date formats in Excel, each show up the result differently.Īssume you are in the welfare team of the company, and you need to send birthday emails to your employees if there are any birthdays. Now I will explain to you the different date formats in Excel. If the result from part 5 is 25, it will add Days. In this part, we are finding the difference between the days. Part 5: “&DATEDIF(B2, C2,” MD”) Now we have a difference between Year and the Month. If the result of part 3 is 4, then this part will add Months to part 3, i.e. Part 4: &” Months” This is the addition to part 3. “YM” can give the difference between months. We find the difference between the months in this part of the formula. Part 3: &DATEDIF(B2, C2, “YM”) Now, we found the difference between years. For example, if the first part gives 4, the result will be 4 Years. Part 2: &” Year” is added to a previous part of the foSo, forla. Part 1: =DATEDIF (B2,C2, “Y”) this is the starting date and ending date, and “Y” means we need to know the difference between years. This can be useful to find the difference between year, month, and day. Total Tenure, we need to use the DATEDIF function.ĭATEDIF function is an undocumented formula where there is no IntelliSense list for it. If we just deduct the relieving date from the joining date, we get the only number of days they worked we get it in detail. DATE function alone cannot do the job for us. Here we need to use the DATEDIF function to get the result as per our wish.
0 Comments
Leave a Reply. |