+ Reply to Thread
Results 1 to 5 of 5

Help with IF and Sum functions

  1. #1
    Registered User
    Join Date
    01-15-2014
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    12

    Help with IF and Sum functions

    I have a spreadsheet with a list of names spread throughout a column (Column A) and some numbers in the next few column (Column B, C, D, E) I'm trying to set up in Column F the ability to use the IF function to pick out certain names (Mike F for example) then add up the corresponding numbers found in the columns next to that name. Now Mike may be listed several times in Col A the way I've set up the statement it's adding up all the numbers in my given range no matter what name is in Col A. Here is the way I've got the function set up:

    =if(A4:A200="Mike F", Sum(B4:B200)+sum(C4:C200)+sum(D4:D200)+sum(E4:E200),0)

    Is there another way to accomplish what I'm trying to do or can it not be done because it doesn't seem to be looking for Mike in Col A, if I put a number next to Andrew it returns that number instead of 0.
    Any help with this is greatly appreciated.
    Thanks
    Bob

  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: Help with IF and Sum functions

    Try this...

    Data Range
    A
    B
    C
    D
    E
    4
    Mike
    5
    59
    80
    83
    5
    Tom
    7
    96
    79
    39
    6
    Lisa
    50
    73
    24
    73
    7
    Brooke
    23
    5
    88
    2
    8
    ------
    ------
    ------
    ------
    ------
    9
    10
    Mike
    227


    This formula entered in B10:

    =SUMPRODUCT((A4:A7=A10)*B4:E7)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    01-15-2014
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with IF and Sum functions

    Don't know if my original response got thru so here it goes:
    I tried your suggestion but the cell ended up saying #N/A "Error Array arguments to MULTIPLY are of different size."
    When I changed the =SUMPRODUCT((A4:A7=A10)*B4:E7) the B4:E7 code to B4:F4 it seemed to work.
    I've included the spreadsheet to see how it's set up
    Attached Files Attached Files

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Help with IF and Sum functions

    You have to have equal number of rows in both ranges of the formula.

    You have
    =SUMPRODUCT((A4:A7=J16)*B4:E12)

    One range is rows 4:7, the other is 4:12
    They need to both be the same

    So you probably want
    =SUMPRODUCT((A4:A12=J16)*B4:E12)

  5. #5
    Registered User
    Join Date
    01-15-2014
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with IF and Sum functions

    Thank you so much!! It works perfectly for what I need it show me.
    Thanks for your help.

+ 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. Replies: 6
    Last Post: 03-17-2015, 01:35 AM
  2. VBA – User Designed Functions (UDF) - Renaming array functions
    By hbsonly in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-03-2013, 02:00 PM
  3. Replies: 1
    Last Post: 02-10-2012, 05:27 PM
  4. AddIn With custom functions - Functions not working in Excel2010
    By brum17 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2011, 08:25 AM
  5. Replies: 0
    Last Post: 11-15-2007, 05:24 AM
  6. [SOLVED] efficiency: database functions vs. math functions vs. array formula
    By nickname in forum Excel General
    Replies: 2
    Last Post: 07-13-2006, 11:30 PM
  7. [SOLVED] Conversion from Spreadsheet Toolkit functions (ESSV....) to EssBase API functions
    By sujay in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-05-2006, 05:20 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