+ Reply to Thread
Results 1 to 12 of 12

formula error for date

Hybrid View

  1. #1
    Registered User
    Join Date
    12-10-2021
    Location
    india
    MS-Off Ver
    version2110
    Posts
    6

    Post formula error for date

    hi everyone

    In current excel file B5 cell having only date like 1,2,3.... but i tried to change it into full date format like 12/12/2021 but am unable to get this format instead of that am getting correct date & month year is not matching every cell getting 1990 as year unable to change year. kindly suppport get the solution for this error. below am mentioned code which i used for that and also i attached the excel file.

    =IF(AND((COLUMN()-1)>31*($A$3-1),MONTH(DATE($A$2+INT(($A$3+$A$1)/12),IF((INT((COLUMN()-1)/31.001)+$A$1)>12,(INT((COLUMN()-1)/31.001)+$A$1-12),INT((COLUMN()-1)/31.001)+$A$1),ROUNDUP(MOD(COLUMN()-1,31.001),0)))=ROUNDUP(MOD($A$1+$A$3-1,12.01),0)),ROUNDUP(MOD(COLUMN()-1,31.001),0),"")
    date.PNG
    kindly support to get the answer
    Last edited by svramkumaar; 12-13-2021 at 12:17 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,163

    Re: formula error for date

    This is much more complicated than it needs to be. Please see simplified formulas in attached file. Also the formula in row 6 is too complicated and simply needs to refer to row 5, with custom formatting Ddd to display the day.


    I have also updated your conditional formatting rules.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    12-10-2021
    Location
    india
    MS-Off Ver
    version2110
    Posts
    6

    Re: formula error for date

    Thank you for the answer
    i seen your attachment in that same format is available no change.
    In B5 current format date is 1,2,3... like this available but i need to change that into 1/1/2021 in this format.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    31,174

    Re: formula error for date

    FORMAT all date cells (B5:NI5) to dd/mm/yyyy [though why as you have the month/year in the title]

    Change cell alignment to vertical 90 degrees
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    12-10-2021
    Location
    india
    MS-Off Ver
    version2110
    Posts
    6

    Re: formula error for date

    Quote Originally Posted by 6StringJazzer View Post
    This is much more complicated than it needs to be. Please see simplified formulas in attached file. Also the formula in row 6 is too complicated and simply needs to refer to row 5, with custom formatting Ddd to display the day.


    I have also updated your conditional formatting rules.
    Thank you for the answer
    i seen your attachment in that same format is available no change.
    In B5 current format date is 1,2,3... like this available but i need to change that into 1/1/2021 in this format.

  6. #6
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: formula error for date

    That seems very complicated. I changed B5 formula to:

    =IF(MOD(COLUMN(B$5)-2,31)>DAY(EOMONTH(DATE($A$2,$A$1,1),INT((COLUMN(B$5)-2)/31)))-1,"",EOMONTH(DATE($A$2,$A$1,1),INT((COLUMN(B$5)-2)/31)-1)+MOD(COLUMN(B$5)-2,31)+1)
    I then changed B6 formula to:

    =IF(B$5="","",VLOOKUP(WEEKDAY(B$5,2),Sheet3!$D$1:$E$7,2,0))
    I copied B5:B6 formulas all the way across to NI5:NI6. Does this work for you now?

    WBD
    Office 365 on Windows 11, looking for rep!

  7. #7
    Registered User
    Join Date
    12-10-2021
    Location
    india
    MS-Off Ver
    version2110
    Posts
    6

    Re: formula error for date

    Thank you for the response

    Am trying to change the B5 cell format from DD to DD/MM/YYYY.
    If am using format cell option in B5 am not getting correct year that is the problem.

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,163

    Re: formula error for date

    Effective but I think it can be further simplified; see my attachment in post #2

  9. #9
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: formula error for date

    Two things:

    1. I think you missed columns AG:NI which are hidden/shown when the month is changed with the triangles. Your current formula can't be copied across from AF5 to AG5.
    2. Using the "ddd" format code is fine provided this doesn't get opened on a non-English OS - that's why I left the hard-coded English days

    WBD

  10. #10
    Registered User
    Join Date
    12-10-2021
    Location
    india
    MS-Off Ver
    version2110
    Posts
    6

    Re: formula error for date

    Quote Originally Posted by WideBoyDixon View Post
    Two things:

    1. I think you missed columns AG:NI which are hidden/shown when the month is changed with the triangles. Your current formula can't be copied across from AF5 to AG5.
    2. Using the "ddd" format code is fine provided this doesn't get opened on a non-English OS - that's why I left the hard-coded English days

    WBD
    Thank you for the response

    Am trying to change the B5 cell format from DD to DD/MM/YYYY.
    If am using format cell option in B5 am not getting correct year that is the problem.

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,163

    Re: formula error for date

    Quote Originally Posted by WideBoyDixon View Post
    1. I think you missed columns AG:NI which are hidden/shown when the month is changed with the triangles. Your current formula can't be copied across from AF5 to AG5.
    You are absolutely correct. I did not notice hidden columns and did not delve into the VBA. I ahd assumed that the month was always shown in the same columns but now that you have pointed this out I see that an entire year is laid out, and the month selection determines which columns are visible.

    To fix this, the formula becomes even simpler, even trivial. Also changes are needed in the VBA, which simplify it. See attached revision.

  12. #12
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: formula error for date

    Missed the replies to this somehow. I made a change to my original upload. See attached.

    WBD

+ 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. Error formula Sumifs and date
    By Habiler in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2021, 06:40 AM
  2. Excel Date Formula Error
    By JClayborn in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-25-2021, 12:49 AM
  3. Error #value! in a date array formula
    By Jiggers in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-01-2019, 02:12 PM
  4. Date formula error on February
    By jackson_hollon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-07-2014, 04:52 AM
  5. [SOLVED] #NUM error with date formula
    By nunayobinezz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-06-2013, 04:24 PM
  6. Error in a Formula in getting a date..
    By e4excel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-24-2010, 03:23 PM
  7. Error when using date formula
    By Malvaro in forum Excel General
    Replies: 4
    Last Post: 07-23-2008, 04:13 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