How to Use Excel Formulas with Time Criteria for Multiple RNTIs
Question details
The user needs to construct an Excel formula to evaluate millisecond time differences (0-5ms) across multiple rows, applying the criteria specifically for each RNTI and LCID 4.

- Product
- Spreadsheets
- Device & OS
- not provided
- Scenario
- Analyzing sequential log data to identify records where the time difference between consecutive events for specific RNTIs and LCID 4 falls within a 5-millisecond threshold.
- Observed behavior
- The user requires a logical formula that accurately processes fractional second thresholds and correctly populates the results for each distinct RNTI in the dataset.
Ensure your dataset is correctly sorted by RNTI and then by timestamp so that row-by-row formula comparisons evaluate consecutive time differences accurately.
Use the IF and AND Functions with a Numeric Time Threshold
Combine multiple logical conditions using the AND function and compare your time differences against Excel's numeric fractional time format.
In Excel and similar spreadsheet programs, time is stored as a fraction of a 24-hour day. A single second is 1/86400 of a day. To evaluate millisecond thresholds, you can use the TIME function or directly divide your millisecond target by 86400.
Ensure the column containing the time differences is formatted as a Number or a Custom Time format that displays milliseconds (e.g., hh:mm:ss.000) so calculations do not drop precision.
To set a 5-millisecond limit, you can use either the formula `TIME(0,0,0.005)` or a direct decimal division `0.005/86400` in your criteria.
Select the first cell in your output column and enter `=IF(AND($A2=$A1,$F2=4,$B2<TIME(0,0,0.005),$G2="YES"),"YES","")`. Adjust column A for your RNTI, F for your LCID, and B for the time difference.
Press Enter, then click and drag the fill handle at the bottom-right corner of the cell down the column to populate the results for all other RNTIs automatically.

Handle Complex Logical Formulas Easily in WPS Office
WPS Spreadsheet seamlessly supports complex nested IF and AND functions, making it effortless to analyze precise log data, calculate millisecond time thresholds, and organize large datasets efficiently.
- 1. Open your data file: Launch WPS Spreadsheet and open the log file containing your RNTI and LCID data.
- 2. Sort the data logically: Navigate to the Data tab, click Sort, and organize your sheet first by RNTI, then by Time.
- 3. Input the precise criteria formula: In an empty column, type `=IF(AND(A2=A1,F2=4,B2<0.005/86400),"YES","")` to evaluate your 5ms threshold.
- 4. Fill down the column: Double-click the fill handle on the cell to apply the formula across thousands of rows instantly.

Frequently Asked Questions
How do I display milliseconds in my spreadsheet cells?
Select the cells you want to format, right-click and choose Format Cells. Go to Custom, and type `hh:mm:ss.000` in the Type box to reveal millisecond precision.
Can I use the FILTER function instead of IF for this data?
Yes. If your spreadsheet version supports Dynamic Arrays, you can extract matching rows using a formula like `=FILTER(A2:G100, (A2:A100=A1:A99) * (F2:F100=4) * (B2:B100<0.005/86400))` instead of placing an IF statement on every row.
Why does my TIME function return an error for fractions of a second?
In some legacy spreadsheet versions, the standard `TIME(hour, minute, second)` function does not consistently process decimals in the seconds argument. Converting the fractional second directly into a daily fraction by dividing by 86400 is the recommended workaround.




