Ask Your Question
3

What is the nearest date in an array that matches a given date in Google Sheets?

asked 2021-12-06 11:00:00 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-08-03 20:00:00 +0000

nofretete gravatar image

You can use the MINIFS function in Google Sheets to find the nearest date in an array that matches a given date. Here's an example formula:

=MINIFS(A:A, A:A, ">="&B1)- where A:A is the range of dates and B1 is the cell containing the given date.

This formula will return the nearest date in column A that is greater than or equal to the date in cell B1. If you want to find the nearest date that is less than or equal to the given date, you can use the MAXIFS function instead:

=MAXIFS(A:A, A:A, "<="&B1)- where A:A is the range of dates and B1 is the cell containing the given date.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-12-06 11:00:00 +0000

Seen: 16 times

Last updated: Aug 03 '22