# Excel question - having a formula to fill in the last entry in a range

**URL:** https://boards.straightdope.com/t/excel-question-having-a-formula-to-fill-in-the-last-entry-in-a-range/664524
**Category:** Factual Questions
**Created:** [July 25, 2013, 9:26pm UTC](https://boards.straightdope.com/t/excel-question-having-a-formula-to-fill-in-the-last-entry-in-a-range/664524 "2013-07-25T21:26:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![StGermain](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/stgermain/32/2868_2.png) [@StGermain](https://boards.straightdope.com/u/StGermain)
#### Post date: [July 25, 2013, 9:26pm UTC](https://boards.straightdope.com/t/excel-question-having-a-formula-to-fill-in-the-last-entry-in-a-range/664524/1 "2013-07-25T21:26:33Z")

</div>

I want a way to complete a dashboard with the month current month’s data, without having to change the cell each month. For example, I have a the following horizontal range:

```auto

Jul-13	Aug-13	Sep-13	Oct-13	Nov-13	Dec-13
0.85	1.00	0.97 0.99	

```

and I want a cell on a different page to show the current month’s data and the YTD total. Is there any way I can look for the last column greater than zero? If I was doing this in Access I might be able to use the “Last” function.

StG

---

<div class="post-metadata">

### Author: ![Scougs](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/scougs/32/3158_2.png) [@Scougs](https://boards.straightdope.com/u/Scougs)
#### Post date: [July 25, 2013, 9:48pm UTC](https://boards.straightdope.com/t/excel-question-having-a-formula-to-fill-in-the-last-entry-in-a-range/664524/2 "2013-07-25T21:48:28Z")

</div>

Assuming you always want the current month, you can use a combination of the Today function and HLOOKUP to get the desired effect.

Assuming the data you’ve given is on the first two rows of Sheet1, and the dates are all the first of the month, this would work:

=hlookup(date(year(today()), month(today()), 1), Sheet1!A:B, 2, false)

I’m on my iPad in a pub, so might not have the brackets quite right.

---

<div class="post-metadata">

### Author: ![StGermain](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/stgermain/32/2868_2.png) [@StGermain](https://boards.straightdope.com/u/StGermain)
#### Post date: [July 26, 2013, 12:38am UTC](https://boards.straightdope.com/t/excel-question-having-a-formula-to-fill-in-the-last-entry-in-a-range/664524/3 "2013-07-26T00:38:30Z")

</div>

That’s a great idea! I’ll give it a try. It would be the previous month (the month-end results are logged), but I might be able to make it work.

StG

---

<div class="post-metadata">

### Author: ![StGermain](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/stgermain/32/2868_2.png) [@StGermain](https://boards.straightdope.com/u/StGermain)
#### Post date: [July 26, 2013, 6:00pm UTC](https://boards.straightdope.com/t/excel-question-having-a-formula-to-fill-in-the-last-entry-in-a-range/664524/4 "2013-07-26T18:00:20Z")

</div>

**Scougs** - Thanks so much for the help - I was able to get it to work wonderfully.

StG
