+ Reply to Thread
Results 1 to 6 of 6

sum if by month is returning #VALUE

  1. #1
    Registered User
    Join Date
    09-25-2013
    Location
    myob,ok
    MS-Off Ver
    Excel 2007
    Posts
    63

    sum if by month is returning #VALUE

    In my worksheet, I recently started using this function =IF(A2<>"",TODAY(),"")
    Basically whenever a value in A2 is entered. B2 gives me a date. I dragged down the function in my column so it can be automatic.
    The problem now is, My excel function to calculate profit =SUM(IF(MONTH(B15:B9000)=A1,H15:H9000)) is returning a #VALUE
    A1 is January aka 1 to represent the first month.

    Any help on how to get around this issue will be greatly appreciated. Thank you.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: sum if by month is returning #VALUE

    When you apply MONTH function to a text value like "" you get #VALUE!

    You can add another IF to the SUM to cut those out, i.e.

    =SUM(IF(B15:B9000<>"",IF(MONTH(B15:B9000)=A1,H15:H9000)))

    .......but if you use TODAY() in column B won't they always update to the current date, don't you want them to remain at the date when you entered the value?
    Audere est facere

  3. #3
    Registered User
    Join Date
    09-25-2013
    Location
    myob,ok
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: sum if by month is returning #VALUE

    Thank you. And yes that is so true, I did not think of that. How can I have it remain at the date when I entered the value?

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: sum if by month is returning #VALUE

    You need a worksheet change event - something like this

  5. #5
    Registered User
    Join Date
    09-25-2013
    Location
    myob,ok
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: sum if by month is returning #VALUE

    Thank you.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: sum if by month is returning #VALUE

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. [SOLVED] Returning the later month from 2 month names
    By jennieS in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-05-2013, 05:00 AM
  2. Returning a month on a spreadsheet
    By bumpty in forum Excel General
    Replies: 4
    Last Post: 06-24-2011, 11:24 AM
  3. TEXT & MONTH Formulas returning wrong Month
    By dwoodrocksyourb in forum Excel General
    Replies: 2
    Last Post: 10-07-2010, 10:52 AM
  4. Returning the month and yr of a date
    By PRodgers4284 in forum Excel General
    Replies: 2
    Last Post: 04-24-2009, 07:27 PM
  5. Workaround for returning month name?
    By Marty in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-14-2005, 07:06 PM

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