+ Reply to Thread
Results 1 to 14 of 14

Combine Vlookup with iferror and sums it up

  1. #1
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Combine Vlookup with iferror and sums it up

    Hi,

    I need help with combining this statement. I need to lookup a item in worksheet and then sums up the total and if not item is found then leave it blank. I managed to built the statements with don't know how to combine it all together.

    =SUM(VLOOKUP(F7,'Accrual List'!$D:$K,8,0)) ==> this one sums up the total but if nothing found gives me #N/A

    =IFERROR(VLOOKUP(F2,'Accrual List'!$D:$K,8,FALSE),"") ==> this one leaves a blank if #N/A but doesn't help when it doesn't sum up.

    How do I combine these 2 things into one statement.

    Thank you

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Combine Vlookup with iferror and sums it up

    Maybe like this:

    =SUM(IFERROR(VLOOKUP(F7,'Accrual List'!$D:$K,8,0),0)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Combine Vlookup with iferror and sums it up

    Maybe this:
    =SUMIF(VLOOKUP(F7,'Accrual List'!$D:$K,8,0),VLOOKUP(F7,'Accrual List'!$D:$K,8,0),"<>",VLOOKUP(F7,'Accrual List'!$D:$K,8,0))

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Combine Vlookup with iferror and sums it up

    Hi,
    I don't understand the use of SUM with VLOOKUP. A VLOOKUP returns a single value so what's SUM meant to do.

    If you have your data in a regular two dimensional table then personally I'd use a Pivot Table. Amongst other advantages its peforms the dual role of summing data for particular subsets.

    Upload the workbook and manually add the results you want if you need more definitive help.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Combine Vlookup with iferror and sums it up

    I think that you want this:

    =SUMIFS('Accrual List'!$K:$K,'Accrual List'!$D:$D, F7,'Accrual List'!$K:$K,"<>")

  6. #6
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: Combine Vlookup with iferror and sums it up

    None of these formula's work. Reason I need to have sum is because there are more then 1 of those lookup in Accrual sheet. I need to add them together.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Combine Vlookup with iferror and sums it up

    OK, let's start again!

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.

  8. #8
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Combine Vlookup with iferror and sums it up

    So you are NOT combining 2 formula as you said in FP, but actually 3 or more?

    Anyway I think a SUMIFS as per Paul M's post will deliver success, but I don't understand your data well enough to suggest a specific syntax.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Combine Vlookup with iferror and sums it up

    Quote Originally Posted by gill123 View Post
    None of these formula's work. Reason I need to have sum is because there are more then 1 of those lookup in Accrual sheet. I need to add them together.
    As I said in #4, upload the workbook. Anonymised if necessary.

  10. #10
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Combine Vlookup with iferror and sums it up

    Lookups are text functions, SUM is a numeric function. Its oil and water 99% of the time.

    The reason being generally whatever criteria you are using to return a value from the lookup can just be criteria in a conditional SUM (SUMIF, SUMIFS, SUMPRODUCT, etc).

    A sample file and a description of what you want to accomplish (not what you have done that isnt working anyhow) would help us help you.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  11. #11
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: Combine Vlookup with iferror and sums it up

    I have uploaded the worksheet
    Attached Files Attached Files

  12. #12
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Combine Vlookup with iferror and sums it up

    As I said earlier,

    Use a pivot table and avoid the need for any formulae.
    See attached
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Combine Vlookup with iferror and sums it up

    If I didnt misunderstand it seems like a simple SUMIF:

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


    see attached
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: Combine Vlookup with iferror and sums it up

    @Zer0Cool your formula works. Thank you everyone for helping me resolve this issue.

+ 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. How to combine IF, IFerror and Vlookup formula?
    By jgomez in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-30-2016, 04:10 AM
  2. iferror with vlookup
    By cape in forum Excel General
    Replies: 4
    Last Post: 01-11-2015, 01:19 PM
  3. [SOLVED] combine IF and IFERROR
    By johnandrews in forum Excel General
    Replies: 8
    Last Post: 12-15-2014, 02:27 PM
  4. combine macro that sums per color with a specific date (day)
    By lelebrasa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2014, 06:47 PM
  5. Replies: 10
    Last Post: 11-06-2012, 08:31 AM
  6. [SOLVED] Writing code for a function to combine iferror and vlookup
    By tommyko in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2012, 05:39 PM
  7. combine IFAND with IFERROR?
    By simplify in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-08-2009, 02:31 AM

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