+ Reply to Thread
Results 1 to 12 of 12

How to "return the last value entered in a column"?

  1. #1
    Registered User
    Join Date
    03-07-2007
    Posts
    3

    How to "return the last value entered in a column"?

    Folks,

    I have a spreadsheet with two colums were new values are entered every day. On the bottom of theese colums I want to be able to see the sum of the last to values entered. How can I make this go automaticly? My teori is to make the last sum entered in each column appear in two cells, and then sum theese to cells. But I can't seem to find a function that works for this. I've tried the "IF" function, but I can only make it work on two cells on a row (=IF(A9;A9;A8)) (I want it to go all the way up to A1)

    Thanks in advance

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    This link should help

    http://www.xldynamic.com/source/xld....l#last_numeric

    You can add the two formula's to get the total

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    or

    =INDIRECT("A"&COUNTA(A:A))+INDIRECT("A"&COUNTA(B:B))

    VBA Noob

  4. #4
    Registered User
    Join Date
    03-07-2007
    Posts
    3
    Thank you for your answer. But it seems like the formulas given depends on the last input to be a higher value then the one above. This is not the case in my problem since the daily inputs might have a lower value than the one the day before.

    But I found a sollution to my problem myself . Using the "IF" function, and editing the function with another "IF" function within the first function. It seems to work for me

    =IF(C12;C12;(IF(C11;C11;(IF(C10;C10;(IF(C9;C9;C8)))))))

    Edit: However, it seems only to work with up to 9 cells.... Hmmmmm
    Last edited by OceanCarl; 03-07-2007 at 08:22 AM.

  5. #5
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by OceanCarl
    Thank you for your answer. But it seems like the formulas given depends on the last input to be a higher value then the one above. This is not the case in my problem since the daily inputs might have a lower value than the one the day before.

    But I found a sollution to my problem myself . Using the "IF" function, and editing the function with another "IF" function within the first function. It seems to work for me

    =IF(C12;C12;(IF(C11;C11;(IF(C10;C10;(IF(C9;C9;C8)))))))

    Edit: However, it seems only to work with up to 9 cells.... Hmmmmm
    can you attach a sample file for proper consideration and to make a formula for your purpose.

  6. #6
    Registered User
    Join Date
    03-07-2007
    Posts
    3
    Quote Originally Posted by starguy
    can you attach a sample file for proper consideration and to make a formula for your purpose.
    It don't seem to be possible to attach a Excel document, but here's a screenshot of an example file..
    Attached Images Attached Images

  7. #7
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by OceanCarl
    It don't seem to be possible to attach a Excel document, but here's a screenshot of an example file..
    try this for stock x

    =VLOOKUP(LARGE($B$7:$B$41,1),$B$7:$D441,3,FALSE)

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =OFFSET($D$7,COUNTIF(D7:D41,">0")-1,0)

    VBA Noob

  9. #9
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Do you want to sum the last values in column D & H? If so input formula in cell F44


    =LOOKUP(10^307,D:D)+LOOKUP(10^307,H:H)

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    I tried it and it will return zero.

    If you check his example he has zero down to row 41.

    VBA Noob

  11. #11
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Quote Originally Posted by VBA Noob
    I tried it and it will return zero.

    If you check his example he has zero down to row 41.

    VBA Noob

    Hi VBA Noob,


    Really I tried it and I get the sum value or am I missing something.

  12. #12
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

+ 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