+ Reply to Thread
Results 1 to 3 of 3

sumif does not work if the critera is a cell which is the result of a formula??

  1. #1
    Registered User
    Join Date
    05-05-2015
    Location
    san fransisco
    MS-Off Ver
    2010
    Posts
    2

    sumif does not work if the critera is a cell which is the result of a formula??

    I want to sort through the check register for payee in column "B" and assign
    a three character code to each check payee in column "D". In this example Im
    seaching only for 'chris' pay. Cells in 'D' have 40 '=Ifs", one for each payee.

    Then I wish to sum all the debits to each payee. In this example sum the pay for Chris.

    In this case, the =sumif does not recongnise the 'CHR" in column 'D'. The =sumif
    will work correctly if I type the 'CHR' into the appropriate cells but not if its
    the result of a =IF(,,,,)!


    This is contrary to all that Ive read on the sumif.


    E2=SUMIF($D$1:$D$500,"CHR",$C$1:$C$500 ) > returns 0 unless CHR is manually typed in!

    Ive attached a small example of the real spreadsheet so that anyone can help Id really appreciate it!

    Thanks all

    Charles,
    Attached Files Attached Files

  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: sumif does not work if the critera is a cell which is the result of a formula??

    This part of your formula:

    &IF(LEFT(B2,3)="AMA","AMA",IF(LEFT(B2,3)="IWV","IWV",IF(LEFT(B2,3)="Har","Harbot Freight"," ")))

    Is concatenating a space charater to the end of the first part of the formula such that "CHR" is actually "CHR(space)".

    In the formula in column D, instead of returning a space character return an empty string:

    =IF(LEFT(B2,3)="Pay","CHR",IF(LEFT(B2,3)="Wal","WAL",IF(LEFT(B2,3)="Alb","Alb",IF(LEFT(B2,5)="The H","Hom",IF(LEFT(B2,3)="Gat","Ace",IF(LEFT(B2,3)="Iny","gas",""))))))&IF(LEFT(B2,3)="AMA","AMA",IF(LEFT(B2,3)="IWV","IWV",IF(LEFT(B2,3)="Har","Harbot Freight","")))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    05-05-2015
    Location
    san fransisco
    MS-Off Ver
    2010
    Posts
    2

    Re: sumif does not work if the critera is a cell which is the result of a formula??

    Thanks Tony! It was driving me nuts,,,,excel-ently. I tested the sumif with a space after CHR and it started to work but I also noticed that I had the ranges unequal. Fixed that and that one sumif works. Im still a bit fuzzy on how the 'space' got included. Was it due to the '&' concatenation of the three pairs of IF groups? I will investigate further!

    Charles

+ 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: 0
    Last Post: 04-07-2015, 09:05 PM
  2. [SOLVED] Matching Multiple Critera in SUMIF
    By rooboyz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-30-2014, 02:51 AM
  3. SUMIF with exclusion critera
    By Zanith in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-13-2013, 04:16 PM
  4. SUMIF with mutliple critera
    By bad in excel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-08-2006, 09:02 AM
  5. [SOLVED] help with sumif formula with multiple critera
    By Matt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2006, 02:00 PM

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