Remove duplicate values in googlesheet

How to remove duplicate values in google sheet horizontally. If the values are repeating, how can I remove them and keep one value only.

  1. Keep first value only, and remove the 2nd value that is duplicate in all the given spreadsheet. There are duplicate values as show horizontally, how to remove them all

enter image description here


You can try UNIQUE() and FLATTEN() like below-

=UNIQUE(FLATTEN(B2:D5))

enter image description here