Help with building a Formula "OR" vs "AND"

AudyAnalyst

New Member
Joined
Nov 24, 2021
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am trying to make an "OR" formula (I think). I have two things I need to see in my chart. If the month on the Top Row (E1:P1) falls between the 'Open Date' (C:C) and 'Closed Date'(D:D). However, I need the formula to prioritize the 'Status' (A:A) "Closed". If the Status is "Closed", then there needs to be a "c" in the corresponding month that is equal to the 'Closed Date'(D:D). But I still would like the formula to make an 'o' or 'IP' from when it was first opened (What I am looking for):

1638476390490.png


My Current Formula is: =IF(AND(K$1>=$C7,K$1<=$D7,$A7="Open"),"o",IF(AND(K$1>=$C7,K$1<=$D7,$A7="In Progress"),"IP",IF(AND(K$1>=$C7,K$1<=$D7,$A7="Closed"),"c"," ")))
And what that looks like currently:
1638476423354.png


Think it's possible ? Any help or ideas would be great!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Can you post a sample of your data, rather than an image.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Does row 1 contain dates such as 1/1/2021 formatted as mmm? If so, are they all 1st day of the month?

Noting that row 7 has a Feb opening date, should anything be shown in F7 to reflect that?
 
Upvote 0
Does row 1 contain dates such as 1/1/2021 formatted as mmm? If so, are they all 1st day of the month?

Noting that row 7 has a Feb opening date, should anything be shown in F7 to reflect that?
Yes, It should. The F2 is 02/01/2021.
I don't know why it wouldn't.
1638477531011.png
 
Upvote 0
Can you post a sample of your data, rather than an image.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
I'm sorry, I'm on a work computer and can not download anything. Hope this helps:

StatusProject NumberOpen dateClosed Date1/1/20212/1/20213/1/20214/1/20215/1/20216/1/20217/1/20218/1/20219/1/202110/1/202111/1/202112/1/2021
OpenP0011/1/202112/31/2999oooooooooooo
In ProgressP0021/1/202112/31/2999IPIPIPIPIPIPIPIPIPIPIPIP
In ProgressP0031/1/202112/31/2999IPIPIPIPIPIPIPIPIPIPIPIP
OpenP00412/1/202112/31/2999o
ClosedP00511/1/202112/31/2999cc
ClosedP0062/8/20217/6/2021ccccc
 
Upvote 0
Thanks for that, how about
+Fluff 1.xlsm
ABCDEFGHIJKLMNOP
1StatusProject NumberOpen dateClosed Date01/01/202101/02/202101/03/202101/04/202101/05/202101/06/202101/07/202101/08/202101/09/202101/10/202101/11/202101/12/2021
2OpenP00101/01/202131/12/2999oooooooooooo
3In ProgressP00201/01/202131/12/2999IPIPIPIPIPIPIPIPIPIPIPIP
4In ProgressP00301/01/202131/12/2999IPIPIPIPIPIPIPIPIPIPIPIP
5OpenP00401/12/202131/12/2999           o
6ClosedP00501/11/202131/12/2021          oc
7ClosedP00608/02/202106/07/2021 oooooc     
Main
Cell Formulas
RangeFormula
E2:P7E2=IF(AND($A2="Closed",TEXT($D2,"mmyyyy")=TEXT(E$1,"mmyyyy")),"c",IF(AND(EOMONTH($C2,-1)<=E$1,$D2>=E$1),SWITCH($A2,"In Progress","IP","o"),""))
 
Upvote 0
Solution
Thanks for that, how about
+Fluff 1.xlsm
ABCDEFGHIJKLMNOP
1StatusProject NumberOpen dateClosed Date01/01/202101/02/202101/03/202101/04/202101/05/202101/06/202101/07/202101/08/202101/09/202101/10/202101/11/202101/12/2021
2OpenP00101/01/202131/12/2999oooooooooooo
3In ProgressP00201/01/202131/12/2999IPIPIPIPIPIPIPIPIPIPIPIP
4In ProgressP00301/01/202131/12/2999IPIPIPIPIPIPIPIPIPIPIPIP
5OpenP00401/12/202131/12/2999           o
6ClosedP00501/11/202131/12/2021          oc
7ClosedP00608/02/202106/07/2021 oooooc     
Main
Cell Formulas
RangeFormula
E2:P7E2=IF(AND($A2="Closed",TEXT($D2,"mmyyyy")=TEXT(E$1,"mmyyyy")),"c",IF(AND(EOMONTH($C2,-1)<=E$1,$D2>=E$1),SWITCH($A2,"In Progress","IP","o"),""))
Perfect! That solved it. Thank you!
 
Upvote 0
I was a bit slow getting it working but I'll post mine anyway. Check P7 in @fluffs suggestion, should that be "c" or "o"?
Book1
ABCDEFGHIJKLMNOP
101/01/202101/02/202101/03/202101/04/202101/05/202101/06/202101/07/202101/08/202101/09/202101/10/202101/11/202101/12/2021
2Open01/01/202131/12/2999oooooooooooo
3In Progress01/01/202131/12/2999IPIPIPIPIPIPIPIPIPIPIPIP
4In Progress01/01/202131/12/2999IPIPIPIPIPIPIPIPIPIPIPIP
5Open01/12/202131/12/2999           o
6Closed01/11/202131/12/2999          oo
7Closed08/02/202106/07/2021 oooooc     
Sheet1
Cell Formulas
RangeFormula
E2:P7E2=IF(OR(EOMONTH($C2,-1)+1>E$1,EOMONTH($D2,-1)+1<E$1),"",IF($A2="In Progress","IP",IF(AND($A2="Closed",EOMONTH($D2,-1)+1=E$1),"c","o")))
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,483
Members
448,967
Latest member
visheshkotha

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