+ Reply to Thread
Results 1 to 4 of 4

weighted average formula for cells that do NOT match a header label

  1. #1
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    weighted average formula for cells that do NOT match a header label

    Good morning -

    I have columns that reference specific states, and those weighted average formulas work great, because they're matching a specific state name (e.g., CA) with a column that includes the state name. However, there are other states in the source column that don't have headers, and I want them to go into a "Other States" column. The function should be the same, but I can't figure out how to include logic that references something not being true. I attached a spreadsheet that simply (hopefully) simplifies my specific problem. I included notes on the spreadsheet too, for the problem.

    Thank you very much for any help.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: weighted average formula for cells that do NOT match a header label

    Hi,

    It will be problematic to achieve this sort of construction using SUMIFS. You would be better off switching to SUMPRODUCT, though since this function does not ignore text values in the sum range, you will have to adapt this range (N:N) - and therefore all of the ranges - so that it does not include e.g. the column header (Dollars):

    =SUMPRODUCT((1-ISNUMBER(MATCH($M5:$M20,$C$4:$J$4,0)))*($O5:$O20=$B5)*$N5:$N20)/SUMIFS($N:$N,$O:$O,$B5)

    (I chose 20 as the end range reference, though obviously there is no negative impact in increasing this to an arbitrarily larger number; the starting reference, however, should remain at row 5.)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: weighted average formula for cells that do NOT match a header label

    Another approach - somewhat longer formula (array one -> committed with Ctrl+Shift+Enter)

    Please Login or Register  to view this content.
    differece between sum for all and sum for listed

    or ...

    may be too simple to think of, but working idea,
    Why (after filling with formulas C5:J5 - they will be filled anyway I assume) not use:

    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  4. #4
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: weighted average formula for cells that do NOT match a header label

    Kaper - that worked! I continue to be impressed by the knowledge of people on this forum -- and their willingness to help others. Thank you!

+ 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: 4
    Last Post: 01-10-2014, 05:09 PM
  2. weighted average of specific cells in column
    By lamdl in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-30-2013, 03:14 PM
  3. [SOLVED] Average Weighted Grades with Blank Cells
    By JonathanEngr in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-14-2013, 02:25 PM
  4. Weighted average inside group of cells
    By kurtwagner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2012, 12:52 AM
  5. [SOLVED] calculating a weighted average using formula
    By bob green in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 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