

At this point, the report looks something like this: We insert the Item field into the Rows layout area, and then we insert the Date field into the Values area. We start by selecting any cell in the data range, and then use the Insert > PivotTable command. With a few items, it is really fast and easy to filter the PivotTable report for the desired items. This option would be a good fit if you perform this task frequently, and if the list of items is small. We can also accomplish this task with a PivotTable. So, a formula-based approach is one option. We can simply use the following formula in C7: =MAXIFS(tbl_data,tbl_data,B7)Īnd the best part is that the data does not need to be sorted! If your version of Excel has the MAXIFS function, this task will be much easier. We fill the formula down, and we have the max dates, as shown below. The 0 argument value tells the MATCH function to use exact match logic. It returns the date from the first row where the item in B7 is found in the table’s item column tbl_data. The INDEX function returns a value from the tbl_data column, and the MATCH function tells the INDEX function which row. So, let’s say we enter the items in to some cells, like this:Īssuming our transaction table is named tbl_data, we would write the following formula into C7: =INDEX(tbl_data,MATCH(B7,tbl_data,0)) Now, our job is to simply retrieve the first date that appears for each of the selected items. That way, the first row encountered for each item will be the latest (most recent) transaction date. We’ll start with the INDEX/MATCH combination since these functions have been available for decades.įor this to work, we need to begin by sorting the transactions in descending order by date. There are several functions we could use here, including traditional lookup functions such as VLOOKUP or INDEX/MATCH (which would work if the data was sorted descending by date), or MAXIFS if you have a modern version of Excel which supports it (thanks for the assist Donald!). With a FormulaĪ formula-based option would be a good fit if you need to retrieve these values into specific cells in the workbook, for example, in a dashboard, KPI report, or other summary. We’ll look at the following three options: Sound like a plan? Great, let’s do this thing. And, we’ll look at three options and talk about when each may be a good fit depending on the purpose of the workbook. It may look something like this:Īs with just about anything in Excel, there are several ways to accomplish this task. Then, we have a list of items for which we want to find the most recent sale date.

Is there a date function that will allow me to do this?”īased on this question, I imagine a table of sales transactions that may look something like this: “I have a data table of sales information that I would like to be able to pull the last or most current date that a list of items was sold. Thanks Darrell for your question! Objective There are a few fun ways to accomplish this, and so I thought I’d walk through three options.
#Excel current time function how to
In the below example, we have specified 1 as a start date and 2 as an end date.I recently received a question about how to find the most recent transaction date of a list of items. You can refer to a cell, range of cells, or an array containing dates.

start_date: A valid date from where you want to start your calculation.NETWORKDAYS(start_date,end_date,holidays) Arguments In simple words, with NETWORKDAYS you can calculate the difference between two dates, after excluding Saturdays and Sundays, and holidays (which you specify). NETWORKDAYS function returns the count of days between the start date and end date. In the THIRD example, we have used the TODAY function to get the current date and MONTH has returned the month number from it.In the SECOND example, we have supplied the date directly in the function.
:max_bytes(150000):strip_icc()/NOW_Function-5beb12a0c9e77c005159ade0.jpg)
