+ Reply to Thread
Results 1 to 12 of 12

#VALUE - wrong data type

  1. #1
    Registered User
    Join Date
    09-08-2016
    Location
    Brooklyn Center, MN
    MS-Off Ver
    2010
    Posts
    23

    Question #VALUE - wrong data type

    I'm getting an error in one cell when the same formula works in all the other ones. I have tried clearing all the empty cells and making sure all are formatted correctly but it still give me this error! Help please
    Attached Files Attached Files

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: #VALUE - wrong data type

    The formula needs to be entered as an array with CTRL + SHIFT + ENTER
    And to do that, you'll need to unmerge the cells AZ35:BA35

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: #VALUE - wrong data type

    Hi,

    That is the only cell in which the IF condition evaluates to FALSE which is the reason why it is the only cell with an error. The formula itself is not valid without array-entry which you may not do with a merged cell. As it is written the formula does not really make sense to me- could you perhaps clarify why you are comparing an array of year values to the date in A2?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Registered User
    Join Date
    09-08-2016
    Location
    Brooklyn Center, MN
    MS-Off Ver
    2010
    Posts
    23

    Re: #VALUE - wrong data type

    Thank you for your help. That did get rid of the error. Why did it work in all the other cells and not this one? Just trying to figure things out please.

    Also, when I do this the total isn't correct. It is -3.082 from what it should be.

  5. #5
    Registered User
    Join Date
    09-08-2016
    Location
    Brooklyn Center, MN
    MS-Off Ver
    2010
    Posts
    23

    Re: #VALUE - wrong data type

    A2 is the begining of the current year as it is a rolling 12 month calendar for points. I am trying to get a current total of the PTO earned up to the current date.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: #VALUE - wrong data type

    As xlnetwit explained, in all the others, the initial IF evaluated to TRUE
    IN P35 for example
    IF(TODAY()>LOOKUP(2,1/(M2:M32<>""),M2:M32)
    This evaluated to TRUE, so it calucated this
    (SUMPRODUCT(--(WEEKDAY(M2:M32,2)<=5))-COUNTIFS(Q1:Q32,-8)-COUNTIFS(Q2:Q32,"H"))*8*0.0962
    That part is fine, and does not require CTRL+SHIFT+ENTER

    However, in AZ35
    IF(TODAY()>LOOKUP(2,1/(AW2:AW32<>""),AW2:AW32)
    That evaluated to FALSE, So it's calculating this instead
    IF(YEAR(AW2:AW32)<=$A$2,(SUMPRODUCT((WEEKDAY(AW2:AW32,2)<=5)*(AW2:AW32<=TODAY()))-COUNTIFS(BA2:BA32,-8)-COUNTIFS(BA2:BA32,"H"))*8*0.0962

    This new IF(YEAR(AW2:AW32) is the part that requres CTRL+SHIFT+ENTER

    Why it's wrong, I can't say because I don't follow what that calculation is intended to do.

    Can you clarify what you're trying to do with that part of the formula?

  7. #7
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: #VALUE - wrong data type

    Your subordinate IF function reads:
    Please Login or Register  to view this content.
    which is comparing an array of year values {2016,2016, 2016...} to a date 1/1/2016. Since 1/1/2016 is stored as 42370, all year values will be less than that.

  8. #8
    Registered User
    Join Date
    09-08-2016
    Location
    Brooklyn Center, MN
    MS-Off Ver
    2010
    Posts
    23

    Re: #VALUE - wrong data type

    I am trying to get a current total of the PTO earned up to the current date. I am really new to this and have been getting lots of help from the forum! TY!!

    I noticed also that it is counting for the whole month. If I enter anything after today it changes the total which means it's not only to the current date.

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: #VALUE - wrong data type

    Looks like it's the countifs functions that are throwing it off, because they are including the dates that are >today

    Add a criteria to the countifs for AW2:AW32,"<="&TODAY()
    In BOTH fomrulas AZ35 and AZ33

  10. #10
    Registered User
    Join Date
    09-08-2016
    Location
    Brooklyn Center, MN
    MS-Off Ver
    2010
    Posts
    23

    Re: #VALUE - wrong data type

    So then my next question is that if it works in AZ35 then why doesn't it work in Jan-Aug? This is so confusing

  11. #11
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: #VALUE - wrong data type

    It's difficult to take a formula that doesn't do what you want, and 'fix' it without a detailed knowledge of exactly what you want it to do.

    It may be easier to just start from scratch, forget the existing non working formula, and just explain in words what the formula is supposed to do.
    Don't just say count PTO accrued.
    Give detailed description of how to arrive at your desired result, referencing which cells, what criteria etc..

    Take AZ33 and AZ35.
    In your mind, what are the correct answers, and how exactly did you arrive at those answers?

    Since you said the others are wrong now, do the same for another example column.

  12. #12
    Registered User
    Join Date
    09-08-2016
    Location
    Brooklyn Center, MN
    MS-Off Ver
    2010
    Posts
    23

    Re: #VALUE - wrong data type

    This sheet is supposed to keep track of the amount of points and FMLA used on a rolling 12 month period. I wanted to get a total of of the accrued pto from month to month in one cell and another cell that has the pto up to the current day starting from the 1st of the year (PTO is not on a rolling 12 month period). The PTO calculations is basically a way for me to double check a pay-stub for accuracy. I know how to do it manually but wanted it to calculate it for me.

    I am new to the "more than basic" formulas and have learned much from forums, the internet and books. Most of what I have has come from that and most I can "get the idea" from but not much more than that. I know I am asking a lot to try and figure this out. I have really bitten off more than I can chew for my first spreadsheet. I really appreciate any help that I can get.

+ 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] Wrong data type?
    By oceanside in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-23-2018, 02:22 AM
  2. Wrong Data Type
    By Hodge1013 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-17-2015, 09:21 PM
  3. [SOLVED] Wrong data type error message
    By Ian Jemmett in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2014, 05:13 AM
  4. Value used in formula of wrong data type
    By masry6683 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2014, 10:55 AM
  5. wrong data type #VALUE! error
    By osteolass in forum Excel General
    Replies: 3
    Last Post: 06-20-2011, 07:02 PM
  6. Formula returns wrong data type
    By mbrown89 in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 01-30-2010, 12:36 PM
  7. Importing .csv file in vba using ADO - wrong data type
    By Andr7ej in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-30-2009, 08:01 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