Solved

Set formula to find last row of data

Posted on 2013-06-14
593 Views
I have a formula that I need to keep changing as I add rows of data. How can I change this formula to always adjust itself to finding the last row of data when I add new rows? I read something about using the OFFSET function but not sure how to use it.

``````SUMPRODUCT(--(Database!\$H\$4:\$H\$35020=\$A\$10),--(YEAR(Database!\$C\$4:\$C\$35020)=YEAR(C\$18)),--(MONTH(Database!\$C\$4:\$C\$35020)=MONTH(C\$18)),--(Database!\$AP\$4:\$AP\$35020=\$B19),(Database!\$V\$4:\$V\$35020))
``````
0
Question by:Lawrence Salvucci
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 50

Accepted Solution

barry houdini earned 500 total points
ID: 39249684
If you have Excel 2007 or later I'd advise you to use SUMIFS which is faster. With that function you can just reference the whole columns with no significant downside, i.e.

=SUMIFS(Database!\$V:\$V,Database!\$H:\$H\$,\$A\$10,Database!\$AP:\$AP,\$B19,Database!\$C:\$C,">="&EOMONTH(C\$18,-1)+1,Database!\$C:\$C,"<"&EOMONTH(C\$18,0)+1)

If you really want to continue with the current formula then try looking at "dynamic named ranges", see here

regards, barry
0

LVL 1

Author Closing Comment

ID: 39250039
Thanks Barry. I like your approach better.
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Suggested Courses
Course of the Month8 days, 4 hours left to enroll