Function Problems

Use IFERROR and AGGREGATE in WPS Spreadsheets to Find the Latest Course Date

Aamir Naveed AkramAamir Naveed Akram Nov 13, 2026 869 views

Question details

The user needs a WPS Spreadsheets formula that looks up a student ID, returns the latest course date, and displays the corresponding course name using IFERROR and AGGREGATE.

Use IFERROR and AGGREGATE in WPS Spreadsheets to Find the Latest Course Date and Course Name
Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
The user has a course register with student IDs, course names, and course dates and wants to retrieve the latest course for a selected student.
Observed behavior
The desired formula should return the latest date and course name while hiding errors when no matching row exists.
Before you start

Prepare a worksheet with student IDs in column A, course names in column B, and real date values in column C. Leave E2 for the lookup ID, F2 for the latest date, and G2 for the course name.

Solution 1Recommended

Find the Latest Course Date and Course Name with IFERROR and AGGREGATE

Use this complete lookup when you need both the latest course date and the matching course name for a selected student ID.

Assume student IDs are in A2:A100, course names are in B2:B100, and course dates are in C2:C100. The lookup ID is entered in E2.

1
Enter the latest date formula

Select cell F2, type =IFERROR(AGGREGATE(14,6,C2:C100/(A2:A100=E2),1),"No course found"), and press Enter.

2
Enter the course name formula

Select cell G2, type =IFERROR(INDEX(B2:B100,AGGREGATE(15,6,(ROW(B2:B100)-ROW(B2)+1)/((A2:A100=E2)*(C2:C100=F2)),1)),"No course found"), and press Enter.

3
Test the lookup

Type a student ID in E2. F2 shows the latest course date, and G2 shows the corresponding course name.

Find the Latest Course Date and Course Name with IFERROR and AGGREGATE
Formula results are ready: If no courses match the student ID, both cells display "No course found" instead of a formula error.
Direct WPS solution

Use IFERROR and AGGREGATE in WPS Spreadsheets to Retrieve the Latest Course Date and Course Name

Do the lookup directly in WPS Spreadsheets with IFERROR and AGGREGATE. The formulas handle unmatched rows cleanly, return the latest course date and course name, and work in a free, Excel-compatible spreadsheet environment.

  1. 1. Open WPS Spreadsheets: Launch WPS Office, click Spreadsheets, and open the workbook that contains student IDs, course names, and course dates.
  2. 2. Enter the latest-date formula: Select cell F2, type =IFERROR(AGGREGATE(14,6,C2:C100/(A2:A100=E2),1),"No course found"), and press Enter.
  3. 3. Enter the course-name formula: Select cell G2, type =IFERROR(INDEX(B2:B100,AGGREGATE(15,6,(ROW(B2:B100)-ROW(B2)+1)/((A2:A100=E2)*(C2:C100=F2)),1)),"No course found"), and press Enter.
  4. 4. Test the lookup: Type a student ID in E2 and check that F2 shows the latest date and G2 shows the matching course name.
Returns the latest course date and its corresponding course name without exposing formula errors.AGGREGATE can ignore errors and hidden rows, so filtered or messy data still returns a clean result.WPS Spreadsheets opens and saves .xlsx, .xls, and .csv files with Microsoft Excel compatibility.Free, lightweight Office suite with a familiar ribbon interface and no subscription.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my AGGREGATE formula return #VALUE! instead of the latest date?

This usually means the Course Date column contains text instead of real date values, or the compared ranges have different sizes. Select the date column, confirm it is formatted as Date, and use equal-sized ranges such as A2:A100, C2:C100.

Can this formula update when I filter or hide rows in WPS Spreadsheets?

Yes. Change the AGGREGATE option from 6 to 7 in the latest-date formula. Option 7 ignores both hidden rows and error values, so the result updates for visible matching rows.

What if two courses have the same latest date for a student?

The course-name formula returns the first matching row. If you need a tie-breaker, add a helper column that gives a unique priority, such as enrollment time or course ID, and include it in the condition.

Do I need to use Ctrl+Shift+Enter for these AGGREGATE and IFERROR formulas?

In WPS Spreadsheets these formulas can normally be entered with Enter. If the result is not calculated correctly, update WPS Office and confirm that your version supports AGGREGATE.