Forum Discussion
#SPILL! From a Referenced Merged Cell.
SergeiBaklan THANK YOU. Yes, that worked perfectly. Now I have another question that maybe you can help me with. I have a cell on my spreadsheet that should show someone’s age (it should show either current age or age at death, whichever applies). I am trying to find a formula that would calculate these scenarios. I believe it should be an if/then type statement, because whatever the answer, it should populate this one cell. My spreadsheet currently has one cell with the today’s date (DATE), one for the date of birth (DOB) and a cell which would only be populated if the person is deceased (DOD). So, theoretically the age would be found using combinations of those three cells.
That could be
=YEARFRAC(DOB,IF(DOD="",TODAY(),DOD))
and apply desired number format to the result.
- Rebecca_L4Oct 15, 2020Copper Contributor
SergeiBaklan Thank you. I'm sorry for the incessant questions, but here's another: I formatted the cells for date, but I still have to type them in with slashes (ex. 10/15/2020), and I don't understand why. I am wondering if there is a custom one that will work like the phone number one. For phone numbers, I just have to type in 10 numbers and it automatically puts them in the correct form of (123) 456-7890.
- PeterBartholomew1Oct 15, 2020Silver Contributor
Sure, Excel will format dates for you just like it formats phone numbers. The number format
[$-en-US]mm/dd/yyyy
will do it. The catch is that you need to enter
44119
(the number of days elapsed since the start of the 1900s)
- Rebecca_L4Oct 15, 2020Copper Contributor
PeterBartholomew1 yes, that is exactly what's going on here. I don't know why Microsoft did it this way. The average consumer does not think in terms of "days since 1900." I'll just continue to type the dates in long form. Thanks!
- SergeiBaklanOct 15, 2020MVP
Datetime is continuous and sequential. In all cultures it starts from one day which people agree to consider as beginning of their history, after that only representation of the dates counted from that very beginning. Same in software programs, the only difference that's the start date which is chosen. Excel for Windows takes Jan 01, 1900.
Phone numbers are random and have no links with each other, you may take them as it is and apply any format you wish.
You may imitate date format for numbers like
but it'll be the number as in formula bar which can't be calculated as a date and can't be validated as a date.
- PeterBartholomew1Oct 15, 2020Silver Contributor
Ah, that would be because Excel's dates are designed to support calculation.
Your 'long form' comprises the number of times the moon has circuited the Earth, with part periods represented by the number of times the Earth has rotated on its axis and finishing with the number of times the Earth has circuited the Sun since some event deemed to be of importance. BTW, why do you place the smallest interval in the middle?
You see the problem?