If & And Condition based on lookup value change at every 30 row

mba_110

Board Regular
Joined
Nov 28, 2012
Messages
80
Office Version
  1. 365
Platform
  1. Windows
Hi,

Attached table shows list of total degrees, i want once formula reached 30 degrees at any row, from next row it should change lookup value.

I have already mentioned the vlookup position with INDEX + MATCH function the problem is if condition for changing lookup value at every 30 row interval.

My current formula return the FALSE no desired result.


Mirza Bahadur Ali.xlsx
VWXYZAA
6MARCH (مارچ)
715:47:00Sun Set06:22:00Sun Raise21-MarGerg.Date
8
9Total DegreesDegreeEndStartDateStarting Sign
101106:24:4606:22:0021-MarAries
112106:27:3306:24:4721-MarFALSE
123106:30:2006:27:3421-Mar
134106:33:0706:30:2121-Mar
145106:35:5406:33:0821-Mar
156106:38:4106:35:5521-Mar
167106:41:2806:38:4221-Mar
178106:44:1506:41:2921-Mar
189106:47:0206:44:1621-Mar
1910106:49:4906:47:0321-Mar
2011106:52:3606:49:5021-Mar
2112106:55:2306:52:3721-Mar
2213106:58:1006:55:2421-Mar
2314107:00:5706:58:1121-Mar
2415107:03:4407:00:5821-Mar
2516107:06:3107:03:4521-Mar
2617107:09:1807:06:3221-Mar
2718107:12:0507:09:1921-Mar
2819107:14:5207:12:0621-Mar
2920107:17:3907:14:5321-Mar
3021107:20:2607:17:4021-Mar
3122107:23:1307:20:2721-Mar
3223107:26:0007:23:1421-Mar
3324107:28:4707:26:0121-Mar
3425107:31:3407:28:4821-Mar
3526107:34:2107:31:3521-Mar
3627107:37:0807:34:2221-Mar
3728107:39:5507:37:0921-Mar
3829107:42:4207:39:5621-Mar
3930107:45:2907:42:4321-Mar
4031107:48:1607:45:3021-Mar
4132107:51:0307:48:1721-Mar
4233107:53:5007:51:0421-Mar
4334107:56:3707:53:5121-Mar
4435107:59:2407:56:3821-Mar
4536108:02:1107:59:2521-Mar
4637108:04:5808:02:1221-Mar
4738108:07:4508:04:5921-Mar
4839108:10:3208:07:4621-Mar
4940108:13:1908:10:3321-Mar
5041108:16:0608:13:2021-Mar
5142108:18:5308:16:0721-Mar
5243108:21:4008:18:5421-Mar
5344108:24:2708:21:4121-Mar
5445108:27:1408:24:2821-Mar
5546108:30:0108:27:1521-Mar
5647108:32:4808:30:0221-Mar
5748108:35:3508:32:4921-Mar
5849108:38:2208:35:3621-Mar
5950108:41:0908:38:2321-Mar
6051108:43:5608:41:1021-Mar
6152108:46:4308:43:5721-Mar
6253108:49:3008:46:4421-Mar
6354108:52:1708:49:3121-Mar
6455108:55:0408:52:1821-Mar
6556108:57:5108:55:0521-Mar
6657109:00:3808:57:5221-Mar
6758109:03:2509:00:3921-Mar
6859109:06:1209:03:2621-Mar
6960109:08:5909:06:1321-Mar
7061109:11:4609:09:0021-Mar
7162109:14:3309:11:4721-Mar
7263109:17:2009:14:3421-Mar
7364109:20:0709:17:2121-Mar
7465109:22:5409:20:0821-Mar
7566109:25:4109:22:5521-Mar
7667109:28:2809:25:4221-Mar
7768109:31:1509:28:2921-Mar
7869109:34:0209:31:1621-Mar
7970109:36:4909:34:0321-Mar
Sitaron Ki Degree
Cell Formulas
RangeFormula
X10X10=Y10+TIME(,$F$219,$E$219)
Y10Y10=X7
Z10Z10=K219
X11:X79X11=IF(X10<$V$7,Y11+TIME(,$F$219,$E$219),"")
Y11:Y79Y11=X10+TIME(,,1)
AA10AA10=D219
AA11AA11=IF(AND(V10<30,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=30<60,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=60<90,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=90<120,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=120<150,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=150<180,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=180<210,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))
V10V10=W10
V11:V79V11=V10+W11


I hope you understand the concept, i did not mention the lookup table because its rage is already given and it will be excessive size to paste here in XL2BB.

The formula is in cell AA11

Thanks & regards.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi,

Attached table shows list of total degrees, i want once formula reached 30 degrees at any row, from next row it should change lookup value.

I have already mentioned the vlookup position with INDEX + MATCH function the problem is if condition for changing lookup value at every 30 row interval.

My current formula return the FALSE no desired result.


Mirza Bahadur Ali.xlsx
VWXYZAA
6MARCH (مارچ)
715:47:00Sun Set06:22:00Sun Raise21-MarGerg.Date
8
9Total DegreesDegreeEndStartDateStarting Sign
101106:24:4606:22:0021-MarAries
112106:27:3306:24:4721-MarFALSE
123106:30:2006:27:3421-Mar
134106:33:0706:30:2121-Mar
145106:35:5406:33:0821-Mar
156106:38:4106:35:5521-Mar
167106:41:2806:38:4221-Mar
178106:44:1506:41:2921-Mar
189106:47:0206:44:1621-Mar
1910106:49:4906:47:0321-Mar
2011106:52:3606:49:5021-Mar
2112106:55:2306:52:3721-Mar
2213106:58:1006:55:2421-Mar
2314107:00:5706:58:1121-Mar
2415107:03:4407:00:5821-Mar
2516107:06:3107:03:4521-Mar
2617107:09:1807:06:3221-Mar
2718107:12:0507:09:1921-Mar
2819107:14:5207:12:0621-Mar
2920107:17:3907:14:5321-Mar
3021107:20:2607:17:4021-Mar
3122107:23:1307:20:2721-Mar
3223107:26:0007:23:1421-Mar
3324107:28:4707:26:0121-Mar
3425107:31:3407:28:4821-Mar
3526107:34:2107:31:3521-Mar
3627107:37:0807:34:2221-Mar
3728107:39:5507:37:0921-Mar
3829107:42:4207:39:5621-Mar
3930107:45:2907:42:4321-Mar
4031107:48:1607:45:3021-Mar
4132107:51:0307:48:1721-Mar
4233107:53:5007:51:0421-Mar
4334107:56:3707:53:5121-Mar
4435107:59:2407:56:3821-Mar
4536108:02:1107:59:2521-Mar
4637108:04:5808:02:1221-Mar
4738108:07:4508:04:5921-Mar
4839108:10:3208:07:4621-Mar
4940108:13:1908:10:3321-Mar
5041108:16:0608:13:2021-Mar
5142108:18:5308:16:0721-Mar
5243108:21:4008:18:5421-Mar
5344108:24:2708:21:4121-Mar
5445108:27:1408:24:2821-Mar
5546108:30:0108:27:1521-Mar
5647108:32:4808:30:0221-Mar
5748108:35:3508:32:4921-Mar
5849108:38:2208:35:3621-Mar
5950108:41:0908:38:2321-Mar
6051108:43:5608:41:1021-Mar
6152108:46:4308:43:5721-Mar
6253108:49:3008:46:4421-Mar
6354108:52:1708:49:3121-Mar
6455108:55:0408:52:1821-Mar
6556108:57:5108:55:0521-Mar
6657109:00:3808:57:5221-Mar
6758109:03:2509:00:3921-Mar
6859109:06:1209:03:2621-Mar
6960109:08:5909:06:1321-Mar
7061109:11:4609:09:0021-Mar
7162109:14:3309:11:4721-Mar
7263109:17:2009:14:3421-Mar
7364109:20:0709:17:2121-Mar
7465109:22:5409:20:0821-Mar
7566109:25:4109:22:5521-Mar
7667109:28:2809:25:4221-Mar
7768109:31:1509:28:2921-Mar
7869109:34:0209:31:1621-Mar
7970109:36:4909:34:0321-Mar
Sitaron Ki Degree
Cell Formulas
RangeFormula
X10X10=Y10+TIME(,$F$219,$E$219)
Y10Y10=X7
Z10Z10=K219
X11:X79X11=IF(X10<$V$7,Y11+TIME(,$F$219,$E$219),"")
Y11:Y79Y11=X10+TIME(,,1)
AA10AA10=D219
AA11AA11=IF(AND(V10<30,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=30<60,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=60<90,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=90<120,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=120<150,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=150<180,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))=IF(AND(V10>=180<210,AA10=D219),AA10,INDEX($D$219:$D$230,MATCH(AA10,$D$219:$D$230,0)+1))
V10V10=W10
V11:V79V11=V10+W11


I hope you understand the concept, i did not mention the lookup table because its rage is already given and it will be excessive size to paste here in XL2BB.

The formula is in cell AA11

Thanks & regards.
can you describe the basic format and contents of the lookup table and provide a few rows as an example?
 
Upvote 0
can you describe the basic format and contents of the lookup table and provide a few rows as an example?
To Make it easy, i have revised the main table format, almost of all formulas i have made it work correctly, only issues here is with "Starting sign" which is at I9 and "End time" which is at D9, i have left first row as it is because its starting point and can't be changed, just for your information once formulas are corrected i will drag it to below till the last to get all result for formula should accommodate this action.

MAIN TABLE
Mirza Bahadur Ali.xlsx
BCDEFGHI
7Total DegreesDegreeEndStartSun SetSun RaiseDateStarting Sign
8116:25:026:22:1615:47:006:22:1521-MarAries
9226:27:496:25:0315:47:006:22:1521-MarAries
10336:30:366:27:5015:47:006:22:1521-MarAries
11446:33:236:30:3715:47:006:22:1521-MarAries
12556:36:106:33:2415:47:006:22:1521-MarAries
13666:38:576:36:1115:47:006:22:1521-MarAries
14776:41:446:38:5815:47:006:22:1521-MarAries
15886:44:316:41:4515:47:006:22:1521-MarAries
16996:47:186:44:3215:47:006:22:1521-MarAries
1710106:50:056:47:1915:47:006:22:1521-MarAries
1811116:52:526:50:0615:47:006:22:1521-MarAries
1912126:55:396:52:5315:47:006:22:1521-MarAries
2013136:58:266:55:4015:47:006:22:1521-MarAries
2114147:01:136:58:2715:47:006:22:1521-MarAries
2215157:04:007:01:1415:47:006:22:1521-MarAries
2316167:06:477:04:0115:47:006:22:1521-MarAries
2417177:09:347:06:4815:47:006:22:1521-MarAries
2518187:12:217:09:3515:47:006:22:1521-MarAries
2619197:15:087:12:2215:47:006:22:1521-MarAries
2720207:17:557:15:0915:47:006:22:1521-MarAries
2821217:20:427:17:5615:47:006:22:1521-MarAries
2922227:23:297:20:4315:47:006:22:1521-MarAries
3023237:26:167:23:3015:47:006:22:1521-MarAries
3124247:29:037:26:1715:47:006:22:1521-MarAries
3225257:31:507:29:0415:47:006:22:1521-MarAries
3326267:34:377:31:5115:47:006:22:1521-MarAries
3427277:37:247:34:3815:47:006:22:1521-MarAries
3528287:40:117:37:2515:47:006:22:1521-MarAries
3629297:42:587:40:1215:47:006:22:1521-MarAries
3730307:45:457:42:5915:47:006:22:1521-MarAries
383117:48:587:45:4615:47:006:22:1521-MarTaurus
393227:52:117:48:5915:47:006:22:1521-MarTaurus
Sitaron Ki Degree
Cell Formulas
RangeFormula
B8B8=C8
D8D8=IF(I8='Taleh Burj'!D32,TIME(,'Taleh Burj'!$G$32,'Taleh Burj'!$F$32)+E8)
E8E8=G8+TIME(,,1)
F8:F39F8=INDEX('Sunraise & SunSet'!$J$12:$J$22,MATCH(H8,'Sunraise & SunSet'!$L$12:$L$22,0))
G8:G39G8=INDEX('Sunraise & SunSet'!$K$12:$K$22,MATCH(H8,'Sunraise & SunSet'!$L$12:$L$22,0))
I8I8='Burj O Siyarat'!$D$5
B9:B39B9=COUNT($C$8:C9)
C9:C39C9=IF(C8=30,1,C8+1)
D9:D39D9=IF(I9='Taleh Burj'!$D$32,E9+TIME(,'Taleh Burj'!$G$32,'Taleh Burj'!$F$32),IF(I9='Taleh Burj'!$D$33,E9+TIME(,'Taleh Burj'!$G$33,'Taleh Burj'!$F$33),IF(I9='Taleh Burj'!$D$34,E9+TIME(,'Taleh Burj'!$G$34,'Taleh Burj'!$F$34),IF(I9='Taleh Burj'!$D$35,E9+TIME(,'Taleh Burj'!$G$35,'Taleh Burj'!$F$35),IF(I9='Taleh Burj'!$D$36,E9+TIME(,'Taleh Burj'!$G$36,'Taleh Burj'!$F$36),IF(I9='Taleh Burj'!$D$37,E9+TIME(,'Taleh Burj'!$G$37,'Taleh Burj'!$F$37),IF(I9='Taleh Burj'!$D$38,E9+TIME(,'Taleh Burj'!$G$38,'Taleh Burj'!$F$38),IF(I9='Taleh Burj'!$D$39,E9+TIME(,'Taleh Burj'!$G$39,'Taleh Burj'!$F$39),IF(I9='Taleh Burj'!$D$40,E9+TIME(,'Taleh Burj'!$G$40,'Taleh Burj'!$F$40),IF(I9='Taleh Burj'!$D$41,E9+TIME(,'Taleh Burj'!$G$41,'Taleh Burj'!$F$41),IF(I9='Taleh Burj'!$D$41,E9+TIME(,'Taleh Burj'!$G$41,'Taleh Burj'!$F$41),IF(I9='Taleh Burj'!$D$42,E9+TIME(,'Taleh Burj'!$G$42,'Taleh Burj'!$F$42),IF(I9='Taleh Burj'!$D$43,E9+TIME(,'Taleh Burj'!$G$43,'Taleh Burj'!$F$43),IF(I9='Taleh Burj'!$D$44,E9+TIME(,'Taleh Burj'!$G$44,'Taleh Burj'!$F$44)))))))))))))))
E9:E39E9=IF(H9=H8,D8+TIME(,,1),G9)
H9:H39H9=IF(D8<F8,H8,H8+1)
I9:I39I9=IF(C8=30,INDEX('Taleh Burj'!$D$32:$D$43,MATCH(I8,'Taleh Burj'!$D$32:$D$43,0)+1),IF(B8=360,'Taleh Burj'!$D$32,I8))


LOOKUP TABLE
Mirza Bahadur Ali.xlsx
BCDEFG
30نمبربرجبرجStarsبرج بمطابق اطرافشمس فی درجہ قیام
31سکنڈس(S)منٹس (M)
321حملAries مشرقی462
332ثورTaurus جنوبی123
343جوزاءGeminiمغربی583
354سرطانCancerشمالی364
365اسدLeoمشرقی484
376سنبلہVirgoجنوبی404
387ميزانLibraمغربی404
398عقربScorpioشمالی484
409قوسSagittariusمشرقی364
4110جدّيCapricornجنوبی583
4211دلوAquariusمغربی123
4312حُوتPiscesشمالی462
Taleh Burj


FORMULA # 01 (I:9 - Need to Correct as per below requirement)
In above table, when value at B column reaches 360 then it has to start looking up the value from beginning of list which is referenced in look up table, in look up table as you can see there are 12 rows and each row absorb 30 in main table so 30 X 12 = 360 once my formula reach 360 at column B it's giving me error because there is no further value after row 12 in lookup table, in order to avoid this i want formula to start again the lookup value from D:32 of lookup table once it reaches 360 at column B in main table. I have added another if condition in I9 but it still gave me error once B column value reaches 360 need help to fix this issue.


FORMULA # 02 (D:9 - Need to Correct as per below requirement)
In main table sunset time is mentioned in each row, i want formula to cut of the End time at D:9 exactly to sun set time once it greater than Sun set time, end time also has a formula which takes the values from lookup table based on "Stars" duration

for example Sunset time (17:45:05) End Time (17:47:15) Then i need End Time should be 17:45:05 adjusting/limiting the End time to 17:45 Sunset time, because from next row new sun raise and sun set time will be calculated.
 
Upvote 0

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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