Excel Formula and New Year

salameda

New Member
Joined
Jul 27, 2015
Messages
19
I have a spreadsheet that turns cells pink when they are more than 30 days between the In and Out dates entered. Since we have changed from 2022 to 2023 the cells are now showing a negative number. I have included the formula in the cell as well as an image of the spreadsheet. The first two cells are pink as they are over 30 days between dates and the third cell is not pink since it is only 29 days. The fourth cell should be pink and show 62 days but it shows -303.

Thank you for any assistance!

=IFERROR(IF(ISBLANK([@Name]),"",IF(ISBLANK([@[Date In]]),"",IF(ISBLANK([@[Date Out]]),"",TEXT([@[Date Out]],"MM/DD")-TEXT([@[Date In]],"MM/DD")))),"")
 

Attachments

  • Excel.PNG
    Excel.PNG
    15.1 KB · Views: 10

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
How about
Excel Formula:
=IF([@Name]="","",IF(OR([@[Date in]]="",[@[Date out]]=""),"",[@[Date in]]-[@[Date out]]))
 
Upvote 0
This did turn the fourth cell into the correct number of 62, however all of the cells became a negative number.
 
Upvote 0
Not for me it doesn't
Fluff.xlsm
QRS
3Date outDate inDays
408/11/202213/12/202235
508/11/202209/01/202362
608/11/202222/12/202244
723/11/202222/12/202229
Master
Cell Formulas
RangeFormula
S4:S7S4=IF([@Name]="","",IF(OR([@[Date in]]="",[@[Date out]]=""),"",[@[Date in]]-[@[Date out]]))
 
Upvote 0
Not for me it doesn't
Fluff.xlsm
QRS
3Date outDate inDays
408/11/202213/12/202235
508/11/202209/01/202362
608/11/202222/12/202244
723/11/202222/12/202229
Master
Cell Formulas
RangeFormula
S4:S7S4=IF([@Name]="","",IF(OR([@[Date in]]="",[@[Date out]]=""),"",[@[Date in]]-[@[Date out]]))
That is so odd. I tried it again and got a negative number again. Not sure what I'm doing wrong.
 
Upvote 0
In that case can you post a sample of your data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top