+ Reply to Thread
Results 1 to 6 of 6

Reading last non-blank cell in each row at 3 column steps

  1. #1
    Registered User
    Join Date
    09-07-2009
    Location
    Criccieth, Gwynedd
    MS-Off Ver
    Excel 2007
    Posts
    3

    Reading last non-blank cell in each row at 3 column steps

    I have rows of registered people using my charity and I record donations in a cell of their particular row, then calculated tax relief, then in the next column the donation date.

    SMITH / ADDRESS etc / £50.00 / tax 12.50 / 07.09.2009 / NULL / NULL / NULL etc
    JONES / ADDRESS etc / £20.00 / tax 5.00 / 01.09.2009 / £35.00 / tax 8.75 / 06.09.2009 / NULL / NULL / NULL / etc

    I have a series of empty cells awaiting completion with this data as each person makes another donation.

    I acknowledge each donation by letter in Word which accesses this data in Mailmerge.

    I need to have a fixed reference cell at then end of each row, say at row ZZ which has a formula to identify the LATEST donation and insert the value of the donated sum on that date. The info in cell ZZ (latest donated sum) is inserted into the Word document.

    I've thought about VLOOKUP, COUNT, etc but can't make these work in my head.

    Any ideas please?
    Last edited by david55thomas; 09-08-2009 at 09:11 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Reading last non-blank cell in each row at 3 column steps

    Put this formula in ZZ1 and copy it down:

    =INDEX(A1:ZY1, MATCH(LOOKUP(2, 1 / (A1:ZY1<>"") - 2, A1:ZY1),(A1:ZY1), 0) - 2)

    It works by finding the last cell with a value in it and returning the value from the cell two cells to the left, so the tax and date need to be there for every entry.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Reading last non-blank cell in each row at 3 column steps

    Here's the set-up:
    Row_1 contains headings

    Please Login or Register  to view this content.

    Row_2 contains the values under the headings

    This formula returns the last "Amt" in Row_2

    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    09-07-2009
    Location
    Criccieth, Gwynedd
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Reading last non-blank cell in each row at 3 column steps

    That's brilliant ! I just had to tweak the last -2 to read -5 and I found the cell content I needed.

    One more thing - how do I stop the result in ZZ reading #N/A when nothing is found?

    Many thanks

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Reading last non-blank cell in each row at 3 column steps

    Hi David,

    attached is my version of a solution with the formula

    =OFFSET(D2,0,COUNTA($D2:$K2)-2)

    You mentioned that you want to use the information to do a mail merge thank you for each donation. This data layout is not the best solution for that. In my attached workbook, please have a look at sheet 2 and sheet 3.

    Sheet 2 is a list of your donors and their addresses
    Sheet 3 is a list of donations, with one donation per line. It looks up the address from sheet 2 so you can use sheet 3 for the mail merge and also note for each donation whether a thank you note has been sent.

    In your current layout it is quite difficult to keep track of which donations have been acknowledged and which have not. Also, as soon as you start gathering data, you'll soon want to run reports like, how many donations per donor, donations per month and other statistics like that. The table format as in my sheet 3 can easily be used for filtering and sorting or as the basis for a pivot table.

    hope that helps.

    cheers
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Reading last non-blank cell in each row at 3 column steps

    I would just wrap your formula in an IFERROR() trap:

    =IFERROR(INDEX(A1:ZY1, MATCH(LOOKUP(2, 1 / (A1:ZY1<>"") - 2, A1:ZY1),(A1:ZY1), 0) - 4), "")

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1