Comparing date cells and blanks

cmcordova

New Member
Joined
Mar 14, 2023
Messages
13
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. Web
Hello all!

I am trying to compare values in G2 and H2 based on the below criteria:
  • Both are date fields
  • If G2>H2 then "Sales Initiated"
  • If G2<H2 then "Marketing Initiated"
  • If G2=H2 then "Marketing Initiated"
  • If G2 is blank, but H2 is not, then "Sales Initiated"
  • If G2 is not blank, but H2 is blank, then "Marketing Initiated"
  • If both G2 and H2 are blank, then ""

I started with the below formula, but it doesn't take into consideration if one cell is blank and not the other or if they are the same. Any help is greatly appreciated!
=IF(AND(ISBLANK(G2), ISBLANK(H2)),"",IF(G2>H2), "Sales_Initiated", "Marketing_Initiated"))
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(AND(G2="",H2=""),"",IF(AND(H2<>"",OR(G2="",G2>H2)),"Sales Initiated","Marketing Initiated"))
 
Upvote 1
Solution
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(AND(G2="",H2=""),"",IF(AND(H2<>"",OR(G2="",G2>H2)),"Sales Initiated","Marketing Initiated"))
This is great, but doesn't seem to take into account when both cells are blank, which should result in "Marketing Initiated." How would I add that bit? Thanks so much for your help and super quick response, @Fluff !
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Hello @Fluff.

I could really use your help again as the criteria has evolved today. Another date column, I2 has been added.

If G2, H2 and I2 are null then "Sales Initiated"
If G2 > H2 or I2 then "Sales Initiated"
If either H2 or I2 > G2 then "Marketing Intitiated"
In a nut shell, if the date in H2 is before either of the other fields it's "Marketing Initiated" and all other scenarios will be Sales Initiated

I tried to build upon what you gave me yesterday, but I'm missing something:
=IF(AND(G2="",H2="",I2=""),"Sales Initiated",IF(AND(G2<>"",OR(G2="",G2>H2),"Sales Initiated",IF(AND(G2<>"", OR(G2="",G2>I2),"Sales Initiated","Marketing Initiated")

I would be so grateful for your help once again!
 
Upvote 0
How about
Excel Formula:
=IF(AND(H2<>"",OR(H2<G2,H2<I2)),"Marketing Initiated","Sales Initiated")
 
Upvote 0
This is amazing!! I forgot one thing. How would I add if H2=G2 or I2 (and neither are before G2) then = Marketing Intitiated?

I so appreciate your help!!
 
Upvote 0
Maybe
Excel Formula:
=IF(AND(H2<>"",OR(H2<=G2,H2<=I2)),"Marketing Initiated","Sales Initiated")
 
Upvote 0

Forum statistics

Threads
1,215,278
Messages
6,124,023
Members
449,139
Latest member
sramesh1024

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