Members-only tutorial

Watch the video and get the practice sheet with membership.

See membership options

Anders Asks: Find first and last of filter by date

About this Tutorial

Useful for calculation or filters by dates.

Featured Formulas

Video Transcript

<div>0:00 Well, member Anders asks this question and I thought it was really interesting answer and really useful for those who are doing sort Learn how to organize your data effectively with sorting techniques. Opens in new tab of calculations Discover how to perform calculations in your sheets seamlessly. Opens in new tab or filters by dates.<br>0:13 So the question is he has a sort Learn how to organize your data effectively with sorting techniques. Opens in new tab of this transactional sheet, and he's trying to filter Find out how to filter your data to display only what you need. Opens in new tab it and I put them all on the same sheet, but sometimes you'll want all your transactions by date or timestamp Understand how to work with timestamps in your data. Opens in new tab on one tab.<br>0:28 And then you want to like select Explore the query select clause for advanced data retrieval. Opens in new tab and filter Find out how to filter your data to display only what you need. Opens in new tab it on another tab, but I'm going to put it, do it all in one for you to see it.<br>0:35 So he has these dates and each date has a transaction, but some dates there's multiple transactions.

What he's looking to do is it's really easy to set up a filter Find out how to filter your data to display only what you need. Opens in new tab for this information, say, you want to select Explore the query select clause for advanced data retrieval. Opens in new tab a date let's do 24 and you get the date it's and it really is just filtering C and<br>0:57 D. And you're just doing G2, which is the date is equal to the column C to see where Learn how to use the query where clause to refine your data queries. Opens in new tab you have the dates and you get this nice filter Find out how to filter your data to display only what you need. Opens in new tab where Learn how to use the query where clause to refine your data queries. Opens in new tab you have the date and the transaction.<br>1:12 But two things.

One Anders is only looking for the number Get insights on handling numbers in your spreadsheets. Opens in new tab he wants to select Explore the query select clause for advanced data retrieval. Opens in new tab the date and get a number Get insights on handling numbers in your spreadsheets. Opens in new tab .<br>1:19 There are however, some dates that have multiple numbers and really from those dates, he just wants the first one. But in addition to that, sometimes if it is the if it is this sort Learn how to organize your data effectively with sorting techniques. Opens in new tab of array of transactions, he wants the first and the last.<br>1:37 So this filter Find out how to filter your data to display only what you need. Opens in new tab doesn't do it, right? This filter Find out how to filter your data to display only what you need. Opens in new tab shows us the date of the transaction.

And also if we select Explore the query select clause for advanced data retrieval. Opens in new tab the date that has multiple, it shows us everything.<br>1:47 What we need to do here is use index Master the index function to retrieve specific data points. Opens in new tab and what we can, we can use index Master the index function to retrieve specific data points. Opens in new tab to wrap Find out how to wrap text in your cells for better readability. Opens in new tab around this.<br>1:51 And I want to first share Learn how to share your sheets with others effectively. Opens in new tab with you not what index Master the index function to retrieve specific data points. Opens in new tab does, but how would this filter Find out how to filter your data to display only what you need. Opens in new tab works? This filter Find out how to filter your data to display only what you need. Opens in new tab is an array of rows and columns, just like a sheet and index does this index is like, let's say a one, two D 10, and we use row one.<br>2:18 We want column three is going to be the word date, right? So that's row one, column three date. That's how index works.<br>2:28 So we can use that also on this, these answers.

So let's do that. So let's put the index Master the index function to retrieve specific data points. Opens in new tab Brown, we're going to use row one, column two to get that second number Get insights on handling numbers in your spreadsheets. Opens in new tab .<br>2:43 Cause we're doing getting C to D right? Let's do that. And we got 90 and that is the first answer here.<br>2:51 That's pretty simple, right? But we want also now that's works. What's interesting is this works on every date because every date has one until you have something that until you have a date that has known, but there every date has one.<br>3:06 The last one, however, is going to be more complicated because we can't this, this row one.

We, how do we know how many rows there are?<br>3:18 Well, we have this filter Find out how to filter your data to display only what you need. Opens in new tab already here and we can do count. We can count how many things are there, count all, but we're going to get an error Understand common sheet errors and how to resolve them. Opens in new tab here.<br>3:31 And that error Understand common sheet errors and how to resolve them. Opens in new tab is referenced. It it's outside the balance. It's because this C to D is not really what we're counting.<br>3:38 Let's just count. We want the C to C we want that count and we still get an error Understand common sheet errors and how to resolve them. Opens in new tab because probably, Oh, I still have the C to C.<br>3:56 Now we're just counting the answers Explore how to manage and display answers in your sheets. Opens in new tab in this one. We don't have a two dimensional array.

We have a one dimensional array.<br>4:02 Now we have a clear count and let's see what we get. We get 65, which is the same thing. There let's go to two 26.<br>4:13 Now we get 90 here and the last one, 45. So now we know what the first transaction and the last year has action.<br>4:19 Or sometimes these are the same. And I'm not going to go through that in this video. How we figure that out, actually, actually, this is pretty simple.<br>4:27 Let me go over this. Cause this will show up.

This will be a question you're asking is on the dates that have only one.<br>4:35 How do you know that the first and last transaction are like the same number Get insights on handling numbers in your spreadsheets. Opens in new tab , but how do you know that those are the same actual answer?<br>4:43 There's only one row here. What you can do is because we are counting. We can set up a little if so if a logical expression Get to grips with expressions to enhance your data manipulation. Opens in new tab , this is greater less than less than one, no, less than two equals one.<br>5:04 Let's do equals one, do nothing. Right? So only on the dates. There we go. So this will only show up when there is more than one row.<br>5:20 There you go.

So this first, last is nothing. What you might want to do though, is within the here, be like, no, which means not.<br>5:30 There is nothing. Not, not that it's zero. Not that it's nothing. It is just doesn't exist or you'll want to put something else here.<br>5:37 But that right here between these two cop commas is where Learn how to use the query where clause to refine your data queries. Opens in new tab you put the answer that you want to show again.<br>5:43 You can put literally nothing, but it's probably better to show that, Hey, the answer is that there's nothing here. So when it's two 26, let's double check.<br>5:55 There it is 98, 45. And there you go.

That gets you index Master the index function to retrieve specific data points. Opens in new tab and filter Find out how to filter your data to display only what you need. Opens in new tab and count hall and F we'll get you the answer here, bite.</div>