How to extract date value from date value in Microsoft Excel
In some cases you may want to extract a date from a date. Let's say your date is 27/05/2022 and your Excel sheet should be able to tell you that today is Friday. If this could be achieved, it could find applications in many situations, such as finding workdays for items, school assignments, etc.
In this article, we have come up with 3 different solutions that you can use to easily extract date values from date values and automatically apply them to the entire column. Hope you enjoyed this article.
Example Scenario
We have a column named Date which contains date values. The other column Day is empty and its value will be filled by calculating the date value from the corresponding date value in the Date column.
Solution 1: Use the Format Cells option
This is the simplest of all methods as it does not involve any formulas.
Step 1: Copy the entire date value from column 1 (Date column).
You can select the entire data, right-click and select the "Copy" option, or you can select the data# After ## simply press the CTRL C key.
Step 2: Next, click the th column of the column where you want to extract the Day value a cell.
Step 3: Now press the CTRL V key to paste the data.
Step 4:Right-click anywhere in the selected range of cells and click the button named "Settings" Cell" option.
Step 5: In the "Set CellFormat" window, first click "Number"Tab. Next, under Category Options, click Customize Options.
Now, under theType field, enter ddd. Under the Sample section just above the Type field you will be able to view sample data. Because we gave ddd, the example data displays weekday in 3-letter format, which in the following example is Tue.
Click theOK button after completion.
dddd instead of under the Type field ddd. Makes the sample data displayed as Tuesday.
Step 6: That’s it. You have successfully extracted a date value from a date value, it's that simple.
Text().
Step 1:Double-clickthe first cell of the column where you want to extract the date value. Now, copy and paste the following formula onto it. =TEXT(A3,"ddd")
with the desired cell ID that has the date value. Additionally, ddd will give the date in 3-letter format. For example, Tuesday.
If you want a fully formatted date value, such as
, then your formula should have dddd as its first Two parameters instead of ddd.
: If you press elsewhere or press the Enter key, you can see that the formula has been successfully applied, And now the date value is extracted successfully. 如果您想在列中应用公式,只需单击并拖动单元格右下角的小正方形。 第 3 步:您现在拥有 Excel 工作表中所有日期值的日期值。 与本文中列出的前 2 种方法相比,此方法相对复杂。此方法通过结合 2 个公式函数即Choose()和Weekday()从日期值中提取日期值。然而,这种方法有点令人讨厌,但我们喜欢令人讨厌的东西。希望你也这样做。 第 1 步:双击Day 列的第一个单元格以编辑其内容。将以下公式复制并粘贴到其上。 公式中的A3必须替换为具有要从中提取日期值的日期值的单元格的单元格 ID。 上面公式中首先解决的部分是WEEKDAY(A3)。Weekday 函数将日期作为参数,并以整数形式返回工作日。默认情况下,该函数假定一周从星期日到星期六。所以,如果这是一个正常的场景,你可以只给这个函数一个参数。在这个公式中,我只给出了一个参数 A3,它是包含我需要从中查找日期的日期的单元格的单元格 ID。但是,如果您的一周从星期一开始,那么您需要为您的函数再提供一个参数,使其成为 WEEKDAY(A3,2)。因此,在这种情况下,您的最终公式将如下所示。 因此WEEKDAY()函数以数字格式返回一周中的星期几。也就是说,如果这一天是Tuesday,那么WEEKDAY() 将返回 3。 CHOOSE()函数根据其第一个参数从其参数列表中返回一个字符串。 CHOOSE()函数可以有很多参数。第一个参数是索引号。索引号后面的参数是需要根据索引号选取的字符串。例如,如果 CHOOSE() 函数的第一个参数是 1 ,那么 CHOOSE()函数将返回列表中的第一个字符串。 所以在这个特定的场景中,WEEKDAY()函数返回3作为它的返回值。现在CHOOSE()函数将这个3作为它的第一个参数。并根据此索引值返回列表中的第三个字符串。所以CHOOSE()函数最终会返回TUESDAY。 如果您想返回天的短格式,您可以在主公式中进行调整,如下所示。 第 2 步:如果您按Enter键或单击其他任何位置,您可以看到日期值已成功填充到您选择的单元格中。 要将公式应用于列中的所有单元格,请单击单元格角落的小方形图标并将其向下拖动。 第 3 步:该公式现在已成功应用于所有单元格,并且现在将日期值填充到整个列中。解决方案 3:通过组合 CHOOSE 和 WEEKDAY 公式函数
=CHOOSE(WEEKDAY(A3),"SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY")
公式说明
=CHOOSE(WEEKDAY(A3,2),"SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY")
=CHOOSE(WEEKDAY(A3,2),"Sun","Mon","Tue","Wed","Thu","Fri","Sat")
The above is the detailed content of How to extract date value from date value in Microsoft Excel. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Use an Error Checking Tool One of the quickest ways to find errors with your Excel spreadsheet is to use an error checking tool. If the tool finds any errors, you can correct them and try saving the file again. However, the tool may not find all types of errors. If the error checking tool doesn't find any errors or fixing them doesn't solve the problem, then you need to try one of the other fixes below. To use the error checking tool in Excel: select the Formulas tab. Click the Error Checking tool. When an error is found, information about the cause of the error will appear in the tool. If it's not needed, fix the error or delete the formula causing the problem. In the Error Checking Tool, click Next to view the next error and repeat the process. When not

How to Set GoogleSheets Print Area in Print Preview Google Sheets allows you to print spreadsheets with three different print areas. You can choose to print the entire spreadsheet, including each individual worksheet you create. Alternatively, you can choose to print a single worksheet. Finally, you can only print a portion of the cells you select. This is the smallest print area you can create since you could theoretically select individual cells for printing. The easiest way to set it up is to use the built-in Google Sheets print preview menu. You can view this content using Google Sheets in a web browser on your PC, Mac, or Chromebook. To set up Google

It is usually necessary to insert PDF documents into Excel worksheets. Just like a company's project list, we can instantly append text and character data to Excel cells. But what if you want to attach the solution design for a specific project to its corresponding data row? Well, people often stop and think. Sometimes thinking doesn't work either because the solution isn't simple. Dig deeper into this article to learn how to easily insert multiple PDF documents into an Excel worksheet, along with very specific rows of data. Example Scenario In the example shown in this article, we have a column called ProductCategory that lists a project name in each cell. Another column ProductSpeci

Solution to the problem that there are too many different cell formats that cannot be copied: 1. Open the EXCEL document, and then enter the content of different formats in several cells; 2. Find the "Format Painter" button in the upper left corner of the Excel page, and then click " "Format Painter" option; 3. Click the left mouse button to set the format to be consistent.

How to use RANDBETWEEN to generate random numbers in Excel If you want to generate random numbers within a specific range, the RANDBETWEEN function is a quick and easy way to do it. This allows you to generate random integers between any two values of your choice. Generate random numbers in Excel using RANDBETWEEN: Click the cell where you want the first random number to appear. Type =RANDBETWEEN(1,500) replacing "1" with the lowest random number you want to generate and "500" with

On numeric values, on text strings, using commas in the wrong places can really get annoying, even for the biggest Excel geeks. You may even know how to get rid of commas, but the method you know may be time-consuming for you. Well, no matter what your problem is, if it is related to a comma in the wrong place in your Excel worksheet, we can tell you one thing, all your problems will be solved today, right here! Dig deeper into this article to learn how to easily remove commas from numbers and text values in the simplest steps possible. Hope you enjoy reading. Oh, and don’t forget to tell us which method catches your eye the most! Section 1: How to Remove Commas from Numerical Values When a numerical value contains a comma, there are two possible situations:

The SIGN function is a very useful function built into Microsoft Excel. Using this function you can find out the sign of a number. That is, whether the number is positive. The SIGN function returns 1 if the number is positive, -1 if the number is negative, and zero if the number is zero. Although this sounds too obvious, if you have a large column containing many numbers and we want to find the sign of all the numbers, it is very useful to use the SIGN function and get the job done in a few seconds. In this article, we explain 3 different methods on how to easily use the SIGN function in any Excel document to calculate the sign of a number. Read on to learn how to master this cool trick. start up

How to Find Merged Cells in Excel on Windows Before you can delete merged cells from your data, you need to find them all. It's easy to do this using Excel's Find and Replace tool. Find merged cells in Excel: Highlight the cells where you want to find merged cells. To select all cells, click in an empty space in the upper left corner of the spreadsheet or press Ctrl+A. Click the Home tab. Click the Find and Select icon. Select Find. Click the Options button. At the end of the FindWhat settings, click Format. Under the Alignment tab, click Merge Cells. It should contain a check mark rather than a line. Click OK to confirm the format