+ Reply to Thread
Results 1 to 6 of 6

Sum multiple columns using a VLOOKUP only if the columns have a value

Hybrid View

  1. #1
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Sum multiple columns using a VLOOKUP only if the columns have a value

    Hi,
    Any help would be really appreciated on this one.
    I have a spreadsheet with two workbooks and I am trying to lookup a value from Sheet2 in Sheet1 and then sum the value of certain columns only if they all have a value.
    I can get the formula to calculate the columns I want but I cant incorporate it to ignore if all columns are not populated

    Current formula

    {=SUM(VLOOKUP(B4,Sheet1!$B$4:$X$44,{3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22},FALSE))}

    Thanks

    Paul

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sum multiple columns using a VLOOKUP only if the columns have a value

    Let's see if we understand this.

    If Dn:Un contains less than 20 numbers then you want the formula to return a blank?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: Sum multiple columns using a VLOOKUP only if the columns have a value

    Hi Tony,
    Yes that is exactly what I need.

    Thanks

    Paul

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sum multiple columns using a VLOOKUP only if the columns have a value

    Try this array formula**:

    =IF(COUNT(INDEX(Sheet1!$D$4:$U$44,MATCH(B4,Sheet1!$B$4:$B$44,0),0))<20,"",SUM(VLOOKUP(B4,Sheet1!$B$4:$X$44,{3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22},0)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

  5. #5
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: Sum multiple columns using a VLOOKUP only if the columns have a value

    Thank you so much Tony that has worked a treat.
    Regards

    Paul

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sum multiple columns using a VLOOKUP only if the columns have a value

    You're welcome. Thanks for the feedback!

+ 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. Vlookup multiple columns
    By saechaoc in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-26-2015, 05:41 PM
  2. [SOLVED] VLookup - Single value lookup returning multiple records into multiple columns
    By kllovin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-07-2014, 05:14 AM
  3. Combining multiple rows from 2 columns into sorted columns depending on 1st columns value
    By Dexamphetamine in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-11-2013, 10:00 AM
  4. [SOLVED] Vlookup for multiple columns
    By mmccra2858 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-14-2013, 10:22 AM
  5. VLookup multiple columns?
    By Endriuska in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2010, 06:13 PM
  6. Vlookup across multiple columns
    By Taylor_1978 in forum Excel General
    Replies: 2
    Last Post: 04-23-2009, 03:39 AM
  7. Multiple Columns & VLookup??
    By Tara C. in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-12-2005, 01:05 PM

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