In Excel, Identify Data Layers Correctly and Convert Them to a Standardized Table

In Excel, Identify Data Layers Correctly and Convert Them to a Standardized Table

Problem description & analysis:

Data in the column below has three layers: the 1st layer is a string, the 2nd layer is a date, and the 3rd layer contains multiple time values:

A
1NAME1
22024-06-03
304:06:12
404:09:23
508:09:23
612:09:23
717:02:23
82024-06-02
904:06:12
1004:09:23
1108:09:23
12NAME2
132024-06-03
1404:06:12
1504:09:23
162024-06-02
1712:09:23
1817:02:23

We need to identify the three layers of data correctly and convert them to a standardized table:

DEF
1NAME12024-06-0304:06:12
2NAME12024-06-0304:09:23
3NAME12024-06-0308:09:23
4NAME12024-06-0312:09:23
5NAME12024-06-0317:02:23
6NAME12024-06-0204:06:12
7NAME12024-06-0204:09:23
8NAME12024-06-0208:09:23
9NAME22024-06-0304:06:12
10NAME22024-06-0304:09:23
11NAME22024-06-0212:09:23
12NAME22024-06-0217:02:23

Solution:

Use SPL XLL to type in the following formula:

=spl("=E@1(?).(if(ifstring(~):s=~, if(ifdate(E(~))):d=~; [s,d,~])).select(ifa(~))",A1:A18)

SPL returns an integer for the date data. You need to format it into an easy-to-read form through Excel’s "format cells" option (or through SPL’s E() function). Use the same way to handle the time data.

As shown in the picture below:

r/esProc_Desktop - In Excel, Identify Data Layers Correctly and Convert Them to a Standardized Table

Explanation:

E()function converts a value to the Excel date/time data; E@1 converts a multilayer sequence to a single-layer one. ~ represents the current member; if() function judges whether it is a string and whether it is a date from left to right and executes the expressions, and then executes the default expression. ifa() judges whether the variable is a sequence.

esProc Desktop is now free to download and apply conveniently: http://www.scudata.com/download-Desktop