Forum Discussion
Alexis_Dougherty
Mar 05, 2020Copper Contributor
How do you convert from standard time to unix time in Excel?
I am trying to convert standard time into unix for a project, except I don't know the formula to use. I tried this one, which I found online, but it did not convert it correctly: (STANDARDTIMECELL...
- May 14, 2017
I'm sorry but i see no limitations which could prevent to use nested IF. The only point it is a bit less flexible compare to nested If equivalents.
But what to use depends on goals, in some cases quick hardcording works quite fine.
If use formatting nested if becomes much more clear and editable. Like this
=IF(ISNUMBER(SEARCH("Sales", B3,1)),"Sales",
IF(ISNUMBER(SEARCH("Arch", B3,1)),"Architecture",
IF(ISNUMBER(SEARCH("Land", B3,1)),"Land",
IF(ISNUMBER(SEARCH("All", B3,1)),"All",
IF(ISNUMBER(SEARCH("Contracts", B3,1)),"Contracts",
IF(ISNUMBER(SEARCH("Construction", B3,1)),"Construction",
"No Match"
))))))
If instead of hardcoded strings use references nested IF becomes more flexible. And if add some extra references (nested if) for future strings to find it becomes even more flexible.
=IF(ISNUMBER(SEARCH($F$1,B3,1)),$G$1, IF(ISNUMBER(SEARCH($F$2,B3,1)),$G$2, IF(ISNUMBER(SEARCH($F$3,B3,1)),$G$3, IF(ISNUMBER(SEARCH($F$4,B3,1)),$G$4, IF(ISNUMBER(SEARCH($F$5,B3,1)),$G$5, IF(ISNUMBER(SEARCH($F$6,B3,1)),$G$6, IF(ISNUMBER(SEARCH($F$7,B3,1)),$G$7, IF(ISNUMBER(SEARCH($F$8,B3,1)),$G$8, IF(ISNUMBER(SEARCH($F$9,B3,1)),$G$9, "No Match" )))))))))
I don't vote for nested IF, i would like to say where is no limitations here. What to use that's concrete person choice.
SergeiBaklan
Mar 05, 2020MVP
I guess military time is only the matter of formatting - if you have 01:34 time in Excel, applying hhmm it'll be shown as 0134.
Actually in Excel date is integer sequential number starting from 1 which equal to Jan 01, 1900. Time is decimal part of the number, 12:00 will be 12/24 = 0.5
Thus, if you use time only it is assumed Jan 01, 1900 as the date, e.g. 1900-01-01 01:34 for above time. Above formula compares it with 1970-01-01 00:00 and returns wrong result.
In brief, year is to be adjusted, e.g with TODAY(). I'm not sure what is the "time only" in UNIX. But for absolute time it could be like
Alexis_Dougherty
Mar 05, 2020Copper Contributor
SergeiBaklanThat works! Thank you so much!!!
- SergeiBaklanMar 05, 2020MVP
Alexis_Dougherty , great, glad to help. Now I know bit more about UNIX time...