+ Reply to Thread
Results 1 to 16 of 16

Conditional Columns

Hybrid View

  1. #1
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Columns

    Ahh, it's because you don't have February, you have Feb. This modification should work

    =IFERROR(SUMPRODUCT(--(TEXT($A$2:$A$19,"mmm")=D2),$B$2:$B$19)/SUMPRODUCT(--(TEXT($A$2:$A$19,"mmm")=D2)),"")

    changed from "mmmm" which expects the entire month to be written out to "mmm" which expect the 3 character abbreviation. Also I added the IFERROR part to keep out the errors when you don't have a month listed at all.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  2. #2
    Forum Contributor BenMiller's Avatar
    Join Date
    12-06-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    254

    Re: Conditional Columns

    Thanks ChemistB! You are the bomb

  3. #3
    Registered User
    Join Date
    07-18-2012
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional Columns

    Quote Originally Posted by ChemistB View Post
    Ahh, it's because you don't have February, you have Feb. This modification should work

    =IFERROR(SUMPRODUCT(--(TEXT($A$2:$A$19,"mmm")=D2),$B$2:$B$19)/SUMPRODUCT(--(TEXT($A$2:$A$19,"mmm")=D2)),"")

    changed from "mmmm" which expects the entire month to be written out to "mmm" which expect the 3 character abbreviation. Also I added the IFERROR part to keep out the errors when you don't have a month listed at all.
    That worked, however, this was a sample and the rather large document I am working on has some blank cells (not yet entered). The formula is calculating these blank cells as "zeros" and lowering the actual average. I am in over my head!

  4. #4
    Forum Contributor BenMiller's Avatar
    Join Date
    12-06-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    254

    Re: Conditional Columns

    Blank cells ... meaning they have a date in column A but no number in column B?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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