If condition help

VBABEGINER

Well-known Member
Joined
Jun 15, 2011
Messages
1,232
Hi All,

after longtime on board..

I need one help in formula. date mm/dd/yyyy

Excel Formula:
=IF(AND(O1="ML",C1>=8/5/2023) then inner IF formulation should work (i.e. 1st iteration) else if any one condition not true then perform other IF formulation  i.e. (2nd iteration)

How do I achieve the same. Now with my current formula, what happens is, if ML is with less that 8th May date even then it work 1st iteration. Ideally it should give me what return in 2nd iteration. Pls guide..

Infact, even if my Col O and Col C have different values it is giving me False as o/p.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
that post is just once cell with the formula. there is no supporting data.
But it seems you have found a solution. That is great!

Best wishes.
Thank you for your reply. I dont find any solution. The post which pjmorris posted that close to what I want, but need correction. Hence waiting reply from him
 
Upvote 0
Thank you for your reply. I dont find any solution. The post which pjmorris posted that close to what I want, but need correction. Hence waiting reply from him
what I offered was not good? Just paste this in a cell on row 73580
This should read your date format in column C as you have it.

=IF(AND(O73580="ML",C73580>=DATE(2023,5,8))=FALSE,
IF(G73580="","",
IF(I73580<=5,"Week 1",
IF(I73580<=10,"Week 2",
IF(I73580<=20,"Week 3 & 4",
IF(I73580<=30,"Week 5 & 6",
IF(I73580<=40,"Week 7 & 8",
IF(I73580<=50,"Week 9 & 10",
IF(I73580<=60,"Week 11 & 12",
IF(I73580<=70,"Week 13 & 14",
IF(I73580<=80,"Week 15 & 16","FTE")))))))))),

IF(G73580="","",
IF(I73580<=5,"Week 1",
IF(I73580<=10,"Week 2",
IF(I73580<=20,"Week 3 & 4",
IF(I73580<=30,"Week 5 & 6",
IF(I73580<=40,"Week 7 & 8",
IF(I73580<=50,"Week 9 & 10",
IF(I73580<=60,"Week 11 & 12",
IF(I73580<=70,"Week 13 & 14",
IF(I73580<=80,"Week 15 & 16",
IF(I73580<=85,"Week 17",
IF(I73580<=100,"Week 18 & 20",
IF(I73580<=115,"Week 21 & 23",
IF(I73580<=130,"Week 24 & 26","Week 27 onwards" )))))))))))))))
 
Upvote 0
what I offered was not good? Just paste this in a cell on row 73580
This should read your date format in column C as you have it.

=IF(AND(O73580="ML",C73580>=DATE(2023,5,8))=FALSE,
IF(G73580="","",
IF(I73580<=5,"Week 1",
IF(I73580<=10,"Week 2",
IF(I73580<=20,"Week 3 & 4",
IF(I73580<=30,"Week 5 & 6",
IF(I73580<=40,"Week 7 & 8",
IF(I73580<=50,"Week 9 & 10",
IF(I73580<=60,"Week 11 & 12",
IF(I73580<=70,"Week 13 & 14",
IF(I73580<=80,"Week 15 & 16","FTE")))))))))),

IF(G73580="","",
IF(I73580<=5,"Week 1",
IF(I73580<=10,"Week 2",
IF(I73580<=20,"Week 3 & 4",
IF(I73580<=30,"Week 5 & 6",
IF(I73580<=40,"Week 7 & 8",
IF(I73580<=50,"Week 9 & 10",
IF(I73580<=60,"Week 11 & 12",
IF(I73580<=70,"Week 13 & 14",
IF(I73580<=80,"Week 15 & 16",
IF(I73580<=85,"Week 17",
IF(I73580<=100,"Week 18 & 20",
IF(I73580<=115,"Week 21 & 23",
IF(I73580<=130,"Week 24 & 26","Week 27 onwards" )))))))))))))))
HI, no not at all.. Infact i really appreciate your time and response on someone's query. You solution is for me to implement but in my col C I've date format like "mm/dd/yyyy" and in your solution you used different format. So I guess I need to change col C dates format as well if I use your solution.. hence I'm not going with that..
 
Upvote 0
i'm not sure what you mean. It may have had different format in my worksheet on my system. But, if you had pasted the formula from POST #33 and not the xl2bb entirely it should have used only your worksheet formats.

The DATE(2023,5,8) is a function where the input order must always be YYYY,MM,DD. I'm not sure if your version of excel uses semi-colons as argument delimiters or not or even has a different name for the function.
 
Upvote 0
Hi,

Apologies for delay in replying - I've been away.

Below is the test spreadsheet based on a previous post. Please note that I had to insert dates in column G otherwise nothing worked. My formula's are in column K, and I had to correct my previous amendment from MAX to MIN in:

Excel Formula:
=IF(G2="","",
CHOOSE(IF(AND(O2="ML",C2>=DATEVALUE("8/5/2023")), MIN(27,INT(I2/5.001)+1), IF(INT(I2/5.001)+1>16,28,INT(I2/5.001) +1)),
"Week 1","Week 2", "Week 3 & 4", "Week 3 & 4", "Week 5 & 6", "Week 5 & 6", "Week 7 & 8", "Week 7 & 8", "Week 9 & 10", "Week 9 & 10", "Week 11 & 12", "Week 11 & 12","Week 13 & 14", "Week 13 & 14","Week 15 & 16", "Week 15 & 16","Week 17", "Week 18 & 20","Week 18 & 20", "Week 18 & 20","Week 21 & 23", "Week 21 & 23","Week 21 & 23", "Week 24 & 26","Week 24 & 26", "Week 24 & 26","Week 27 Onwards","FTE"))

Book1
ABCDEFGHIJKLMNO
1DateMonthActive StatusProdAID Processing DateCOI Processing DateAID DaysCOI DaysAID WeekCOI WeekAID TargetCOI TargetCenter
201/01/202310101-Jan-231032090Week 1FTE0.251ML
301/02/202310102-Jan-2312332113Week 5 & 6FTE0.51ML
401/03/202310103-Jan-2314232133Week 9 & 10FTE0.71ML
501/04/202310104-Jan-2316332155Week 13 & 14FTE0.91ML
601/05/202310105-Jan-2318332176FTEFTE11ML
701/06/202310106-Jan-23110532199Week 21 & 23FTE11ML
801/07/202310107-Jan-23112532220Week 24 & 26FTE11ML
901/08/202310108-Jan-23114732242Week 27 OnwardsFTE11ML
1001/09/202310109-Jan-23117032265Week 27 OnwardsFTE11ML
1101/10/202310110-Jan-23118932285Week 27 OnwardsFTE11ML
1201/11/202310111-Jan-23121132308Week 27 OnwardsFTE11ML
1301/12/202310112-Jan-23123232330Week 27 OnwardsFTE11ML
1401/01/202410113-Jan-23125232351Week 27 OnwardsFTE11ML
1501/02/202410114-Jan-23127432374Week 27 OnwardsFTE11ML
1601/03/202410115-Jan-23129532395Week 27 OnwardsFTE11ML
1701/04/202410116-Jan-23131632416Week 27 OnwardsFTE11ML
1801/05/202410117-Jan-23133732438Week 27 OnwardsFTE11ML
1901/06/202410118-Jan-23135832460Week 27 OnwardsFTE11ML
Sheet1
Cell Formulas
RangeFormula
I2:I19I2=NETWORKDAYS(G2,C2)
J2:J19J2=IF(OR(H2>C2,H2=""),"",NETWORKDAYS(H2,C2))
K2:K19K2=IF(G2="","", CHOOSE(IF(AND(O2="ML",C2>=DATEVALUE("8/5/2023")), MIN(27,INT(I2/5.001)+1), IF(INT(I2/5.001)+1>16,28,INT(I2/5.001) +1)), "Week 1","Week 2", "Week 3 & 4", "Week 3 & 4", "Week 5 & 6", "Week 5 & 6", "Week 7 & 8", "Week 7 & 8", "Week 9 & 10", "Week 9 & 10", "Week 11 & 12", "Week 11 & 12","Week 13 & 14", "Week 13 & 14","Week 15 & 16", "Week 15 & 16","Week 17", "Week 18 & 20","Week 18 & 20", "Week 18 & 20","Week 21 & 23", "Week 21 & 23","Week 21 & 23", "Week 24 & 26","Week 24 & 26", "Week 24 & 26","Week 27 Onwards","FTE"))
L2:L19L2=IF(H2="","",IF(J2<=10,"Week 1 & 2",IF(AND(J2>10,J2<=20),"Week 3 & 4",IF(AND(J2>20,J2<=30),"Week 5 & 6",IF(AND(J2>30,J2<=40),"Week 7 & 8",IF(AND(J2>=40,J2<=55),"Week 9 & 12",IF(AND(J2>55,J2<=70),"Week 13 & 15",IF(AND(J2>70,J2<=85),"Week 16 & 18",IF(AND(J2>85,J2<=100),"Week 19 & 21",IF(AND(J2>100,J2<=115),"Week 22 & 24","FTE"))))))))))
M2:M19M2=IF(G2="","",IF(K2="Week 1",0.25,IF(K2="Week 2",0.3,IF(K2="Week 3 & 4",0.4,IF(K2="Week 5 & 6",0.5,IF(K2="Week 7 & 8",0.6,IF(K2="Week 9 & 10",0.7,IF(K2="Week 11 & 12",0.8,IF(K2="Week 13 & 14",0.9,IF(K2="Week 15 & 16",1,1))))))))))
N2:N19N2=IF(H2="","",IF(L2="Week 1 & 2",0.2,IF(L2="Week 3 & 4",0.3,IF(L2="Week 5 & 6",0.4,IF(L2="Week 7 & 8",0.5,IF(L2="Week 9 & 12",0.6,IF(L2="Week 13 & 15",0.7,IF(L2="Week 16 & 18",0.8,IF(L2="Week 19 & 21",0.9,IF(L2="Week 22 & 24",1,1))))))))))


Hope that solves the problem.

Regards
 
Upvote 0
why are you now in row 1? all the work I had done was for Row 73580 ? Did you adjust row number accordingly?
what is the error you have in Post #36? What cell(s) is/are wrong? and what are the expected values?
 
Upvote 0
I posted it in row 1 because the OP did so in his sample at whatever post it was. Its quite confusing. The error was having a MAX term in my previous post when I should have had MIN as i needed to limit the range of choice to 27 in certain circumstances.
 
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,897
Members
449,194
Latest member
JayEggleton

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