Spreadsheet: 72221d1272922238-tell-me-which-if-statement-happens-first-samplewbfx050310001
Sheet: program backtest M5 data

Date | O | H | L | C |  |  |  | Win/Lose
2010-05-03 00:00:00 | 1.52464 | 1.52484 | 1.52409 | 1.52409
2010-05-03 00:05:00 | 1.52409 | 1.52424 | 1.5234 | 1.5239
2010-05-03 00:10:00 | 1.5239 | 1.52425 | 1.52374 | 1.52414
2010-05-03 00:15:00 | 1.52414 | 1.52445 | 1.52409 | 1.52445 |  |  |  | SL at |  | 1.5215
2010-05-03 00:20:00 | 1.52445 | 1.5249 | 1.52388 | 1.52405
2010-05-03 00:25:00 | 1.52405 | 1.52405 | 1.5235 | 1.52366 |  |  |  | TP at |  | 1.528
2010-05-03 00:30:00 | 1.52366 | 1.5238 | 1.52325 | 1.5233
2010-05-03 00:35:00 | 1.5233 | 1.52436 | 1.5232 | 1.52431 |  |  |  | In I3 I want a formula that will search range B2:E145 and look for 2 conditions to be met and tell me which one was hit FIRST.
2010-05-03 00:40:00 | 1.52431 | 1.52548 | 1.52431 | 1.52535 |  |  |  | I also want it to look from B2-E2 and then go to B3-E3 and so forth.
2010-05-03 00:45:00 | 1.52535 | 1.52589 | 1.52535 | 1.52536 |  |  |  | When one of the two conditions is met, I would like it to return a value in the cell:
2010-05-03 00:50:00 | 1.52536 | 1.5255 | 1.52493 | 1.52525 |  |  |  | If neither of the conditions are met, then return "Still Open"
2010-05-03 00:55:00 | 1.52525 | 1.52525 | 1.52318 | 1.52361 |  |  |  | Conditions: | Value to Return
2010-05-03 01:00:00 | 1.52361 | 1.52508 | 1.52361 | 1.52478 |  |  |  | Cell <=K5 | "Loser"
2010-05-03 01:05:00 | 1.52478 | 1.52504 | 1.52465 | 1.52478 |  |  |  | Cell >=K7 | "Winner"
2010-05-03 01:10:00 | 1.52478 | 1.52493 | 1.52473 | 1.52473 |  |  |  | Cell<>K5,K7 | "Still Open"
2010-05-03 01:15:00 | 1.52473 | 1.52523 | 1.52473 | 1.52494
2010-05-03 01:20:00 | 1.52494 | 1.52506 | 1.52493 | 1.52505 |  |  |  | I do not care to know whether both were hit.
2010-05-03 01:25:00 | 1.52505 | 1.52506 | 1.52425 | 1.52425
2010-05-03 01:30:00 | 1.52425 | 1.52525 | 1.52415 | 1.52525
2010-05-03 01:35:00 | 1.52525 | 1.52605 | 1.52516 | 1.52575
2010-05-03 01:40:00 | 1.52575 | 1.52575 | 1.52509 | 1.52536
2010-05-03 01:45:00 | 1.52536 | 1.52613 | 1.52535 | 1.52605
2010-05-03 01:50:00 | 1.52605 | 1.52625 | 1.5259 | 1.52605
2010-05-03 01:55:00 | 1.52605 | 1.5261 | 1.52512 | 1.52522
2010-05-03 02:00:00 | 1.52522 | 1.52568 | 1.52435 | 1.52457
2010-05-03 02:05:00 | 1.52457 | 1.52496 | 1.52456 | 1.52485
2010-05-03 02:10:00 | 1.52485 | 1.52571 | 1.52481 | 1.52561
2010-05-03 02:15:00 | 1.52561 | 1.52611 | 1.52561 | 1.52605
2010-05-03 02:20:00 | 1.52605 | 1.52606 | 1.52486 | 1.52486
2010-05-03 02:25:00 | 1.52486 | 1.5251 | 1.52435 | 1.52447
2010-05-03 02:30:00 | 1.52447 | 1.52505 | 1.52431 | 1.52488
2010-05-03 02:35:00 | 1.52488 | 1.52555 | 1.52426 | 1.52432
2010-05-03 02:40:00 | 1.52432 | 1.52475 | 1.52345 | 1.52443
2010-05-03 02:45:00 | 1.52443 | 1.5247 | 1.52416 | 1.52445
2010-05-03 02:50:00 | 1.52445 | 1.52471 | 1.52403 | 1.52443
2010-05-03 02:55:00 | 1.52443 | 1.52443 | 1.52307 | 1.52365
2010-05-03 03:00:00 | 1.52365 | 1.52441 | 1.52345 | 1.52346
2010-05-03 03:05:00 | 1.52346 | 1.52415 | 1.52325 | 1.52333
2010-05-03 03:10:00 | 1.52333 | 1.52337 | 1.52238 | 1.52255
2010-05-03 03:15:00 | 1.52255 | 1.52277 | 1.52193 | 1.52265
2010-05-03 03:20:00 | 1.52265 | 1.52266 | 1.52194 | 1.52225
2010-05-03 03:25:00 | 1.52225 | 1.52226 | 1.521 | 1.52141
2010-05-03 03:30:00 | 1.52141 | 1.52195 | 1.5212 | 1.52177
2010-05-03 03:35:00 | 1.52177 | 1.52235 | 1.52177 | 1.52227
2010-05-03 03:40:00 | 1.52227 | 1.52344 | 1.52207 | 1.52294
2010-05-03 03:45:00 | 1.52294 | 1.52327 | 1.52266 | 1.52326
2010-05-03 03:50:00 | 1.52326 | 1.52386 | 1.52326 | 1.52369
2010-05-03 03:55:00 | 1.52369 | 1.5246 | 1.52329 | 1.52455
2010-05-03 04:00:00 | 1.52455 | 1.52565 | 1.52451 | 1.52505
2010-05-03 04:05:00 | 1.52505 | 1.52563 | 1.52485 | 1.52545
2010-05-03 04:10:00 | 1.52545 | 1.52561 | 1.52518 | 1.52526
2010-05-03 04:15:00 | 1.52526 | 1.52526 | 1.52411 | 1.52475
2010-05-03 04:20:00 | 1.52475 | 1.52531 | 1.52468 | 1.52485
2010-05-03 04:25:00 | 1.52485 | 1.52505 | 1.52423 | 1.52479
2010-05-03 04:30:00 | 1.52479 | 1.52568 | 1.52465 | 1.52526
2010-05-03 04:35:00 | 1.52526 | 1.52527 | 1.52415 | 1.5243
2010-05-03 04:40:00 | 1.5243 | 1.52438 | 1.52413 | 1.52416
2010-05-03 04:45:00 | 1.52416 | 1.52525 | 1.52413 | 1.52485
2010-05-03 04:50:00 | 1.52485 | 1.525 | 1.52456 | 1.52487
2010-05-03 04:55:00 | 1.52487 | 1.52501 | 1.52365 | 1.52365
2010-05-03 05:00:00 | 1.52365 | 1.52371 | 1.52245 | 1.52278
2010-05-03 05:05:00 | 1.52278 | 1.52285 | 1.5218 | 1.52202
2010-05-03 05:10:00 | 1.52202 | 1.52215 | 1.52145 | 1.52215
2010-05-03 05:15:00 | 1.52215 | 1.52296 | 1.52215 | 1.52295
2010-05-03 05:20:00 | 1.52295 | 1.52295 | 1.52259 | 1.52271
2010-05-03 05:25:00 | 1.52271 | 1.52275 | 1.52221 | 1.52275
2010-05-03 05:30:00 | 1.52275 | 1.52275 | 1.52265 | 1.5227
2010-05-03 05:35:00 | 1.5227 | 1.52323 | 1.52264 | 1.52318
2010-05-03 05:40:00 | 1.52318 | 1.52357 | 1.52302 | 1.52355
2010-05-03 05:45:00 | 1.52355 | 1.52375 | 1.52338 | 1.52338
2010-05-03 05:50:00 | 1.52338 | 1.52357 | 1.52277 | 1.52279
2010-05-03 05:55:00 | 1.52279 | 1.52304 | 1.52262 | 1.52263
2010-05-03 06:00:00 | 1.52263 | 1.5236 | 1.52261 | 1.52343
2010-05-03 06:05:00 | 1.52343 | 1.52375 | 1.52333 | 1.52355
2010-05-03 06:10:00 | 1.52355 | 1.52408 | 1.52355 | 1.52377
2010-05-03 06:15:00 | 1.52377 | 1.52432 | 1.52373 | 1.52427
2010-05-03 06:20:00 | 1.52427 | 1.52454 | 1.52397 | 1.52405
2010-05-03 06:25:00 | 1.52405 | 1.52575 | 1.52387 | 1.52517
2010-05-03 06:30:00 | 1.52517 | 1.5255 | 1.52505 | 1.5255
2010-05-03 06:35:00 | 1.5255 | 1.5255 | 1.52516 | 1.52526
2010-05-03 06:40:00 | 1.52526 | 1.52536 | 1.52505 | 1.52526
2010-05-03 06:45:00 | 1.52526 | 1.52535 | 1.52518 | 1.52525
2010-05-03 06:50:00 | 1.52525 | 1.52525 | 1.5245 | 1.52511
2010-05-03 06:55:00 | 1.52511 | 1.52516 | 1.52489 | 1.52496
2010-05-03 07:00:00 | 1.52496 | 1.5252 | 1.52483 | 1.52512
2010-05-03 07:05:00 | 1.52512 | 1.52595 | 1.52512 | 1.52571
2010-05-03 07:10:00 | 1.52571 | 1.52576 | 1.52551 | 1.52552
2010-05-03 07:15:00 | 1.52552 | 1.5256 | 1.52526 | 1.52545
2010-05-03 07:20:00 | 1.52545 | 1.5257 | 1.5253 | 1.5256
2010-05-03 07:25:00 | 1.5256 | 1.52695 | 1.5256 | 1.52639
2010-05-03 07:30:00 | 1.52639 | 1.52671 | 1.52624 | 1.52671
2010-05-03 07:35:00 | 1.52671 | 1.52677 | 1.52624 | 1.52634
2010-05-03 07:40:00 | 1.52634 | 1.52652 | 1.52594 | 1.52623
2010-05-03 07:45:00 | 1.52623 | 1.52625 | 1.52563 | 1.52563
2010-05-03 07:50:00 | 1.52563 | 1.52566 | 1.5252 | 1.52527
2010-05-03 07:55:00 | 1.52527 | 1.52535 | 1.52503 | 1.52512
2010-05-03 08:00:00 | 1.52512 | 1.52663 | 1.52512 | 1.52633
2010-05-03 08:05:00 | 1.52633 | 1.52645 | 1.52571 | 1.52573
2010-05-03 08:10:00 | 1.52573 | 1.52596 | 1.52476 | 1.5249
2010-05-03 08:15:00 | 1.5249 | 1.52565 | 1.52483 | 1.52551
2010-05-03 08:20:00 | 1.52551 | 1.52551 | 1.52499 | 1.525
2010-05-03 08:25:00 | 1.525 | 1.5257 | 1.52483 | 1.52532
2010-05-03 08:30:00 | 1.52532 | 1.52575 | 1.52524 | 1.52535
2010-05-03 08:35:00 | 1.52535 | 1.52554 | 1.52516 | 1.52547
2010-05-03 08:40:00 | 1.52547 | 1.52575 | 1.5248 | 1.5251
2010-05-03 08:45:00 | 1.5251 | 1.52522 | 1.52485 | 1.52503
2010-05-03 08:50:00 | 1.52503 | 1.52522 | 1.52486 | 1.52495
2010-05-03 08:55:00 | 1.52495 | 1.52511 | 1.52425 | 1.52428
2010-05-03 09:00:00 | 1.52428 | 1.52461 | 1.52373 | 1.52445
2010-05-03 09:05:00 | 1.52445 | 1.52575 | 1.52445 | 1.52538
2010-05-03 09:10:00 | 1.52538 | 1.5259 | 1.525 | 1.52584
2010-05-03 09:15:00 | 1.52584 | 1.52726 | 1.52584 | 1.5268
2010-05-03 09:20:00 | 1.5268 | 1.52719 | 1.5265 | 1.52655
2010-05-03 09:25:00 | 1.52655 | 1.52715 | 1.5265 | 1.527
2010-05-03 09:30:00 | 1.527 | 1.52743 | 1.52678 | 1.52711
2010-05-03 09:35:00 | 1.52711 | 1.52751 | 1.52711 | 1.5274
2010-05-03 09:40:00 | 1.5274 | 1.52795 | 1.5273 | 1.52789
2010-05-03 09:45:00 | 1.52789 | 1.52815 | 1.52739 | 1.5281
2010-05-03 09:50:00 | 1.5281 | 1.52815 | 1.52739 | 1.52739
2010-05-03 09:55:00 | 1.52739 | 1.5276 | 1.5269 | 1.52701
2010-05-03 10:00:00 | 1.52701 | 1.52756 | 1.5265 | 1.52744
2010-05-03 10:05:00 | 1.52744 | 1.5275 | 1.52675 | 1.52725
2010-05-03 10:10:00 | 1.52725 | 1.52755 | 1.52703 | 1.52734
2010-05-03 10:15:00 | 1.52734 | 1.52745 | 1.52672 | 1.52703
2010-05-03 10:20:00 | 1.52703 | 1.52757 | 1.52668 | 1.52678
2010-05-03 10:25:00 | 1.52678 | 1.527 | 1.52611 | 1.52626
2010-05-03 10:30:00 | 1.52626 | 1.5263 | 1.52449 | 1.52458
2010-05-03 10:35:00 | 1.52458 | 1.52466 | 1.52243 | 1.52416
2010-05-03 10:40:00 | 1.52416 | 1.52431 | 1.52364 | 1.52377
2010-05-03 10:45:00 | 1.52377 | 1.52396 | 1.52345 | 1.52378
2010-05-03 10:50:00 | 1.52378 | 1.52426 | 1.52299 | 1.52356
2010-05-03 10:55:00 | 1.52356 | 1.52361 | 1.52212 | 1.52266
2010-05-03 11:00:00 | 1.52266 | 1.5235 | 1.52219 | 1.52346
2010-05-03 11:05:00 | 1.52346 | 1.52353 | 1.52274 | 1.52331
2010-05-03 11:10:00 | 1.52331 | 1.52437 | 1.52326 | 1.52426
2010-05-03 11:15:00 | 1.52426 | 1.52485 | 1.52426 | 1.52436
2010-05-03 11:20:00 | 1.52436 | 1.52481 | 1.52391 | 1.52426
2010-05-03 11:25:00 | 1.52426 | 1.52435 | 1.52376 | 1.52381
2010-05-03 11:30:00 | 1.52381 | 1.52416 | 1.52289 | 1.52289
2010-05-03 11:35:00 | 1.52289 | 1.52345 | 1.5228 | 1.52332
2010-05-03 11:40:00 | 1.52332 | 1.52345 | 1.52144 | 1.52176
2010-05-03 11:45:00 | 1.52176 | 1.52281 | 1.52174 | 1.52267
2010-05-03 11:50:00 | 1.52267 | 1.52335 | 1.52261 | 1.52333
2010-05-03 11:55:00 | 1.52333 | 1.52401 | 1.52315 | 1.52391