Dharmesh
Dharmesh

Reputation: 5

How insert value in new column in google sheets using query funtion

I have a column shown in the figure I want to add a new column based on the condition morning (6 AM-12 PM), afternoon (12:00:00–18:00:00), evening (18:00:00 24:00:00), and night (24:00:00–06:00:00) so if time is 07:00:00 then the value in my column should be morning. I want to add value to google sheets using the query function.

enter image description here

Upvotes: 0

Views: 49

Answers (1)

player0
player0

Reputation: 1

use:

=IFNA(INDEX(VLOOKUP(A1:A*1, {
 0, "night"; 
 "6:00:00" *1, "morning"; 
 "12:00:00"*1, "afternoon"; 
 "18:00:00"*1, "evening"}, 2, 1)))

Upvotes: 1

Related Questions