Sivakesav
Sivakesav

Reputation: 31

How to get temperature of datetime value based on the table which contains day and night wise temperature data

I have data of temperature in a table which shows the temperature of day time(09:00-21:00) and night time(21:00-09:00) for 15 days. I want to get the temperature for any datetime value based on the table I have.

The table data is like this enter image description here

I want to know the temperature for a particular date time value enter image description here

I have tried to use vlookup function =VLOOKUP(A2,F1:H31,3,0) in B2 cell but it does not helped me. I have attached file here

Upvotes: 0

Views: 331

Answers (1)

Gravitate
Gravitate

Reputation: 3064

You can use MAXIFS to find the temperature where your specified datetime falls between the "from" and "To" values:

=MAXIFS($H$2:$H$16,$F$2:$F$16,"<" & $A2,$G$2:$G$16,">=" & $A2)

Upvotes: 2

Related Questions