+ Reply to Thread
Results 1 to 9 of 9

VLookup to return a YTD sum

  1. #1
    Registered User
    Join Date
    08-08-2013
    Location
    Colorado, USA
    MS-Off Ver
    365
    Posts
    44

    VLookup to return a YTD sum

    I have data in a sheet for the months. I want the user to be able to put in the number of the month they want (i.e. "4" for "April") in a cell, and have a formula return a value for the Month and YTD amount (i.e. January-April).

    I don't want to have 12 different columns for YTD numbers, so I'd like the formula to look at the month the user input then use that to determine the YTD amount.

    Maybe Vlookup isn't the best way. Any suggestions would be appreciated.

    Sample file is attached (note, this is a very simplified example of what I need. The actual data has hundreds of lines.).

    Using Excel 2010.

    Thanks in advance!
    David
    Attached Files Attached Files

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: VLookup to return a YTD sum

    In C4, use formula as..

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Drag down for other results..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    Registered User
    Join Date
    08-08-2013
    Location
    Colorado, USA
    MS-Off Ver
    365
    Posts
    44

    Re: VLookup to return a YTD sum

    I may have simplified my example too much.

    The formula will need to do a sum from data on another tab, which may or may not have the same number of rows. For example, in my example sheet, "Revenue" may actually be an account number like 123-04, which may or may not exist on the other tab. The formula will need to look for the account in A4 in another tab, return "0" if it doesn't find it (I'll use an IF(ISNA) for that) and return the sum if it does. Attached is a more accurate sample.
    Attached Files Attached Files

  4. #4
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: VLookup to return a YTD sum

    =SUM(($A$12:$A$14=$A4)*(MONTH($B$10:$M$10&1)<=$C$1)*($B$12:$M$14))

    this array formula, need to press CTRL-SHIFT-ENTER button together, and copied down or find the file attach
    Attached Files Attached Files
    Last edited by azumi; 11-25-2014 at 01:38 PM.

  5. #5
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: VLookup to return a YTD sum

    Another approach..


    In C8
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-08-2013
    Location
    Colorado, USA
    MS-Off Ver
    365
    Posts
    44

    Re: VLookup to return a YTD sum

    Debraj Roy, I think that's exactly what I need. Thanks!

  7. #7
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: VLookup to return a YTD sum

    Thanks for the feedback ..

  8. #8
    Registered User
    Join Date
    09-27-2018
    Location
    Sydney, Australian
    MS-Off Ver
    2010
    Posts
    1

    Re: VLookup to return a YTD sum

    Hi there

    Thanks Barnett2000 for submitting this question, I have a similar question but instead of using an integer for the months, what if it is in the format 31/1/18, 28/2/18, 31/3/18 for both the lookup as well as the range? Or must you use month function?

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: VLookup to return a YTD sum

    Hi veganvonteese. Welcome to the forum.

    Unfortunately your post does not comply with Rule 4 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] return zero in a VLOOKUP
    By edunne in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-15-2014, 06:16 AM
  2. Replies: 1
    Last Post: 02-20-2014, 08:42 AM
  3. [SOLVED] Formula to always return cell below what a vlookup would return
    By KCHEXCEL in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-28-2013, 12:57 AM
  4. [SOLVED] vlookup of two items to return a third vlookup value into a cell
    By PhoenixFaery in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2013, 07:33 PM
  5. Worksheet function Vlookup and VLOOKUP return different results
    By zandero in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2010, 08:24 AM

Tags for this Thread

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