+ Reply to Thread
Results 1 to 13 of 13

Excel 2007 : #VALUE - Tracing problem cells?

  1. #1
    Registered User
    Join Date
    10-26-2008
    Location
    u.K
    Posts
    21

    #VALUE - Tracing problem cells?

    I have a formula which SUMS totals based on a single condition which is a range of dates. It basically calculates my total spending each month from another worksheet. I've done this for every month for the past 10 years and the formula works for some months but not others. Where it doesn't work I receive a #VALUE! error. I'm fairly certain it's down to the formatting of particular cells but because of the amount of data being processed I'm not sure how to check.

    The formula i'm using is this

    =SUMPRODUCT(('Other Receipts'!D3:D2050>=DATEVALUE("1/1/2001"))*('Other Receipts'!D3:D2050<=DATEVALUE("31/1/2001")),'Other Receipts'!F3:F2050)

    This (should be) totaling all my purchases in £ currency from the work sheet "Other Receipts" made during January 2001.

    Column D: is formatted to Currency £ and column F: is Date in the format dd/mm/yyyy

    Now on this particular occassion the formula works. However when i repeat for other months like February it doesn't. What I'm finding is that is it works for Jan 2000 it works for Jan 2000 to 2009. Where it doesn't work for example, February 2000 it then won't work for Feb 2000 to 2009.

    Some of the data tkaen from column D: on "Other Receipts" may be blank and it's blank intentionally, it maybe that the price is zero or null because I don't have an actual record of the price. This is also the case for some of the dates where a cell in column F: (Date) may be blank because I don't have a record of what the date is. Now, I don't think this is resulting in the #VALUE! error as where the formula sometimes works it's also including these null/zero cells.

    Going back to what I originally mentioned, it may be the formatting of a particular cell in the range of the formula has changed, i.e. is no longer £ currency is D: or no longer Date xx/xx/xxxx in column F:

    My question is how can I trace what the problem is, or what is actually the problem? Any help greatly appreciated.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: #VALUE - Tracing problem cells?

    Is it only dates in the range Other Receipts'!D3:D2050 ? i.e any text...

    Does this change anything?

    =SUMPRODUCT(--('Other Receipts'!D3:D2050>=DATEVALUE("1/1/2001")),--('Other Receipts'!D3:D2050<=DATEVALUE("31/1/2001")),'Other Receipts'!F3:F2050)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: #VALUE - Tracing problem cells?

    Try =ISNUMBER(D1) and drag down and do the same for dates. Any that return false are text. Another way is to put 1 in any cell, copy it and paste special-->multiply over the currency and date columns. That should force them to become numbers.

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: #VALUE - Tracing problem cells?

    Another way to find out where the formula bombs is to check it with the Evaluate Formula tool (Tools - Formula Auditing - Evaluate formula). With 2000 values in the array, it may be a bit difficult, but you should be able to spot #Value! quickly!

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: #VALUE - Tracing problem cells?

    Quote Originally Posted by teylyn
    With 2000 values in the array, it may be a bit difficult, but you should be able to spot #Value! quickly!
    FWIW, "way back when" I put together the basics (with help from others) for analysing Sumproducts on a transactional basis...
    The primary purpose of which was to act as a training tool (to elaborate as to how SUMPRODUCTs evaluate) and to ape Bob Phillips' white paper demo's but in "live" form... I also find this add-in can be useful in establishing rows generating errors etc...

    http://www.excelforum.com/developmen...ct-matrix.html

    (if you opt to look at it I would advocate using the last version listed)
    Last edited by DonkeyOte; 11-26-2009 at 06:06 PM. Reason: added quote - ie reason for adding this

  6. #6
    Registered User
    Join Date
    10-26-2008
    Location
    u.K
    Posts
    21

    Re: #VALUE - Tracing problem cells?

    Quote Originally Posted by NBVC View Post
    Is it only dates in the range Other Receipts'!D3:D2050 ? i.e any text...

    Does this change anything?

    =SUMPRODUCT(--('Other Receipts'!D3:D2050>=DATEVALUE("1/1/2001")),--('Other Receipts'!D3:D2050<=DATEVALUE("31/1/2001")),'Other Receipts'!F3:F2050)
    Yes and No, everything is a date with 3 exceptions, one cell is null and 2 cells are dates but as the dd is unknown they are listed as 00/01/2000. Again I don't think this is an issue as these 3 cells are run in the same formula that works for some months just not others.

    I have also tried that exact formula you posted, still causes the same #VALUE! error.

    Quote Originally Posted by darkyam View Post
    Try =ISNUMBER(D1) and drag down and do the same for dates. Any that return false are text. Another way is to put 1 in any cell, copy it and paste special-->multiply over the currency and date columns. That should force them to become numbers.
    Ok firstly I tried =ISNUMBER(F3-2xxx) Results were
    4 FALSES where the currency was in dollars, checking the month and year against the original formula showed it wasn't affecting it, the formula was working where it was including these cells, furthermore I intend to update to £'s when I have the correct exchange amount.

    I had a handful of FALSES where the entry was null (blank) again this included months/years where the formula worked so can't be that.

    When trying on column D: which is Date

    3 x FALSE for the pre-mentioned dates 2 starting 00/xx/xxxx and all the other FALSES were blank, again same conclusion as above. Formula seems unaffected when it includes these cells.

    I'll come back to your other suggestion, as I need to duplicate my file incase I royally screw anything up first.

    Quote Originally Posted by teylyn View Post
    Another way to find out where the formula bombs is to check it with the Evaluate Formula tool (Tools - Formula Auditing - Evaluate formula). With 2000 values in the array, it may be a bit difficult, but you should be able to spot #Value! quickly!
    Sorry I'm unfamiliar with this tool. I can get the tool to run but I don't understand the results. After clicking evaluate for abit "#VALUE!" is popping up in multiple places throughout the formula. I ran this in one of the cells where the formula wasn't working.

    Quote Originally Posted by DonkeyOte View Post
    FWIW, "way back when" I put together the basics (with help from others) for analysing Sumproducts on a transactional basis...
    The primary purpose of which was to act as a training tool (to elaborate as to how SUMPRODUCTs evaluate) and to ape Bob Phillips' white paper demo's but in "live" form... I also find this add-in can be useful in establishing rows generating errors etc...

    http://www.excelforum.com/developmen...ct-matrix.html

    (if you opt to look at it I would advocate using the last version listed)
    I'm going to try this now.

    Edit: Ok tried it. i'm not sure what I'm looking at to be honest. However the easiest why for me to dechiper it was to run it on both a working and non-working cell. Basically the second result column is filled with #VALUE! however, this is both true on the working and non-working cell. In other words, there is no visible difference in the results of this add-on between a working and non-working cell, so now I'm thoroughly confused.

    Please Login or Register  to view this content.
    Not sure this will format correctly
    Last edited by antispam246; 11-26-2009 at 06:49 PM.

  7. #7
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: #VALUE - Tracing problem cells?

    cool! That's a valuable addition to my toolbox!!

    I especially liked this bit in the thread:
    Quote Originally Posted by DonkeyOte
    I am of good character and can be trusted...

  8. #8
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: #VALUE - Tracing problem cells?

    Hahaha! I agree with teylyn. You know what they say about people who have to tell you they're honest right?

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: #VALUE - Tracing problem cells?

    I will look at this in more detail later... presently the board is pretty slow making doing anything quite difficult.

    Given the nature of your calculation it should not matter if D contains non-numerics (no coercion of those values is taking place), same holds true of range F given the final range is not being explicitly coerced the non-numerics would simply be ignored.

    Having looked at the output of the Analyser it does seem odd that the >= Jan 1 array works but <= Jan 31 does not given they're using the same range - ie you would expect both or neither to fail.

    The only thing I would say is that you would get a #VALUE error if the date strings you used in the DATEVALUE function were not valid, eg "31/2/2003" etc...
    the strings you enter should be appropriate to the regional settings on your client

    Assuming the issue is not with the date strings... can you post a sample file which contains the data as stored on 'Other Receipts' - we need only the data as held in D & F - everything else can be cleared (ie nothing confidential - just dates and numbers).

    On an aside another variant of your approach if always conducting monthly analysis would be:

    Please Login or Register  to view this content.
    the text conversion is regarded as being relatively slow but (and it's a big butt) it will still handle non-date values at source without throwing an error and is obviously a little easier to code - ie you need not concern yourself with assigning the correct date values - merely the correct MMYY string for the month in question.

    (you would also get #VALUE! error using this method if arrays were of differing dimensions - not seemingly the case in this instance)

  10. #10
    Registered User
    Join Date
    10-26-2008
    Location
    u.K
    Posts
    21

    Re: #VALUE - Tracing problem cells?

    Quote Originally Posted by DonkeyOte View Post

    On an aside another variant of your approach if always conducting monthly analysis would be:

    Please Login or Register  to view this content.
    the text conversion is regarded as being relatively slow but (and it's a big butt) it will still handle non-date values at source without throwing an error and is obviously a little easier to code - ie you need not concern yourself with assigning the correct date values - merely the correct MMYY string for the month in question.

    (you would also get #VALUE! error using this method if arrays were of differing dimensions - not seemingly the case in this instance)
    This seems like it's working, I'm just checking through it now to double check it is but I've tried multiple times replacing the error prone formula and it's working. Thank you, you're a star. I'll come back to this so I can re-read over and try to establish the initial problem.
    Last edited by DonkeyOte; 11-27-2009 at 10:49 AM. Reason: reduced quote to relevant specifics

  11. #11
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: #VALUE - Tracing problem cells?

    Quote Originally Posted by antispam246
    I'll come back to this so I can re-read over and try to establish the initial problem.
    If the revised version worked for you then that implies that either of or both of the date strings you were using within the DATEVALUE functions were invalid - ie could not be coerced - eg DATEVALUE("31/2/2003")
    (in reality given the errors outlined that was the only cause that seemed possible)

  12. #12
    Registered User
    Join Date
    10-26-2008
    Location
    u.K
    Posts
    21

    Re: #VALUE - Tracing problem cells?

    Quote Originally Posted by DonkeyOte View Post
    If the revised version worked for you then that implies that either of or both of the date strings you were using within the DATEVALUE functions were invalid - ie could not be coerced - eg DATEVALUE("31/2/2003")
    (in reality given the errors outlined that was the only cause that seemed possible)
    Thanks. Do you mind clarifying that "could not be coerced"? What would be the reason?

    Also your formula works throughout, just finished checking. One minor glitch I've noticed though. How does this particular formula cope with null values? Specifically where the date cell is empty? One of the earliest dates and entries in my data has an empty date value and it looks like the formula has some how concluded that this empty cell date falls into 0100 (Janurary 2001) as it's including the amount within it. Technically the result from the formula should be £0.00 as there is no cell in that date range but it's including an empty cell with no date. This is the only cell with an empty date, I should really try to fill it but as I can't conclude it why would it add it into this particular formula?

    The funny thing is, for this particular sum, if I use the old formula it works correctly (old as in the initial one i posted) which returns £0.00

    Edit: To clarify

    Please Login or Register  to view this content.
    Results correctly with £0.00

    Please Login or Register  to view this content.
    Results in £11.97 which is the value of column F: in the no date row.
    Last edited by antispam246; 11-27-2009 at 11:43 AM.

  13. #13
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: #VALUE - Tracing problem cells?

    One minor glitch I've noticed though...
    Sorry, my bad, if you have blanks then use MMYYYY format rather than MMYY
    Blanks are 0 and in date terms that equates to 0 Jan 1900* , 0 Jan 1900 is of course 0100 in MMYY format as is 1 Jan 2000 but if you apply YYYY format you can differentiate (011900, 012000).

    Do you mind clarifying that "could not be coerced"?
    Dates in XL are Numbers - 27th Nov being 40144*
    (time is decimal - ie noon is 0.5, 6am is 0.25, 6pm is 0.75)

    The DATEVALUE function converts a date string to a date value - ie from text to number, so for ex. DATEVALUE("27-Nov-09") converts the string to a date (and thus a number).

    It follows then that if the string is not a valid date the coercion will fail, eg DATEVALUE("31-Feb-2003") ... that date does not exist thus there is no date value associated with that string, in this instances this attempted coercion will generate #VALUE!

    It is in essence the same as saying

    =VALUE("10")

    which converts the string "10" to the number 10, however,

    =VALUE("Apple")

    generates #VALUE! as "apple" can not be coerced to a number.

    (*on 1900 date system)

+ 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