Value corresponding to flag cell

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
959
Office Version
  1. 2007
Platform
  1. Windows
My input data is in Range1
Range1: B2:G12; values are either of +ve or -ve values or zero or null, columns are contiguous.

There is another ‘flag’ range which is below Range 1 i.e. below B2:G12 at B14:G14.
B14:G14 is either of 100 or <>100 with a caveat that at a time, at the most, only one 1 cell of B14:G14 may contain 100

Output range: J2:J12 (for which formula is requested) as detailed below

For J2:J12:
Example for J2:
Formula should look for value 100 in ‘flag’ range B14:G14 & then find its analogous cell’s value in the corresponding row of Range1. Here G2 for row #2 since 100 found in G22.

How to accomplish please?
Sheet2

BCDEFGHIJ
28.008.008.008.008.008.00 8.00
399.001.2528.0028.0041.25-88.00 -88.00
499.0028.0028.0028.0041.25-80.00 -80.00
588.0028.0028.0028.0041.25-80.00 -80.00
628.0028.0028.0028.0041.25-80.00 -80.00
7-100.0020.0020.0020.001.005.00 5.00
81.000.000.000.00-65.0050.00 50.00
9-85.000.000.000.00-65.0050.00 50.00
10
110.000.000.000.000.000.00 0.00
12 0.000.00
13
1400000100

<colgroup><col style="FONT-WEIGHT: bold; WIDTH: 30px"><col style="WIDTH: 51px"><col style="WIDTH: 51px"><col style="WIDTH: 51px"><col style="WIDTH: 51px"><col style="WIDTH: 51px"><col style="WIDTH: 51px"><col style="WIDTH: 5px"><col style="WIDTH: 9px"><col style="WIDTH: 64px"></colgroup><tbody>
</tbody>
 
Last edited:

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,562
Office Version
  1. 365
Platform
  1. Windows
How about
=INDEX(B2:G2,MATCH(100,$B$14:$G$14,0))
 

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
959
Office Version
  1. 2007
Platform
  1. Windows
How about
=INDEX(B2:G2,MATCH(100,$B$14:$G$14,0))
Mostly works….2 things

Formula should give null “” if null “” found not zero 0
If there is no 100 in either of the B14:G14, then instead of #N/A, null is required
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,562
Office Version
  1. 365
Platform
  1. Windows
Ok, how about
=IF(ISBLANK(INDEX(B2:G2,MATCH(100,$B$14:$G$14,0))),"",IFERROR(INDEX(B2:G2,MATCH(100,$B$14:$G$14,0)),""))
 

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
959
Office Version
  1. 2007
Platform
  1. Windows
Ok, how about
=IF(ISBLANK(INDEX(B2:G2,MATCH(100,$B$14:$G$14,0))),"",IFERROR(INDEX(B2:G2,MATCH(100,$B$14:$G$14,0)),""))

Mind blowing speed & efficiency.. great it works..thanks Fluff
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,562
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback
 

Forum statistics

Threads
1,141,707
Messages
5,707,983
Members
421,539
Latest member
zuniBM

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
Top