IF AND Formula

jh3268

New Member
Joined
Mar 23, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Having some issues trying to input an IF AND formula. I have Columns A-I but need conditions to be met on two of these.

Column B is a date/time
Column H is formatted with conditional formatting to Show either blank or YES.

I need the formula to show as TRUE if the date in Column B is more than 24 hours old from the current date/time AND I need Column H to show YES in the dropdown. If not true, I would like to leave blank, but it FALSE is needed, I can work with that.

Any help would be much appreciated!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Perhaps something like this:
Excel Formula:
=IF(AND(TEXT(NOW()-B2,"[h]")*1>24,H2="Yes"),TRUE,"")
 
Upvote 0
Solution
Perhaps something like this:
Excel Formula:
=IF(AND(TEXT(NOW()-B2,"[h]")*1>24,H2="Yes"),TRUE,"")
I don't understand the logic of turning the numerical data into text with the TEXT function and then forcing the result back to numerical by multiplying by 1?
Wouldn't this (keeping everything numerical) do the same thing?

Excel Formula:
=IF(AND(NOW()-B2>1,H2="YES"),TRUE,"")
 
Upvote 1
I don't understand the logic of turning the numerical data into text with the TEXT function and then forcing the result back to numerical by multiplying by 1?
Wouldn't this (keeping everything numerical) do the same thing?

Excel Formula:
=IF(AND(NOW()-B2>1,H2="YES"),TRUE,"")
Because I am not well experienced with date/time functions and don't know how the decimal portion breaks down into hours/minutes/seconds, so converting to something that actually read as "24" instead of 1.xxx made sense to me. I know it's been posted here before, but I usually avoid answering any time/date related questions.
 
Upvote 0

Forum statistics

Threads
1,215,482
Messages
6,125,060
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top