Count # of cells to the left of a value

Jing

Active Member
Joined
Feb 11, 2011
Messages
289
Hey Guys,

it has been a while since i have been here but i'm stuck on a formula. I have the following formula that finds the first instance in a range that is greater than a goal / target value =INDEX($C1:$O1,MATCH(TRUE,INDEX($C1:$O1>$A1,0),)). with the it would return 30 and 75 respectively. What i am trying to find out is a count of the # of cells to the left of the value in the range. so in the case of Row 1 the count would be 6 as there are 6 cells from column C:H. and row 2 would = 9.

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[TD]N[/TD]
[TD]O[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]25[/TD]
[TD][/TD]
[TD]2[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]30[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]10[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]60[/TD]
[TD][/TD]
[TD]3[/TD]
[TD]5[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]75[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
Any help would be greatly appriciated.

Thank you in advance.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Match gives you the answer, just get rid of the first index function.


Excel 2010
ABCDEFGHIJKLMNO
1256200003001100000
260935000000754500
Sheet7
Cell Formulas
RangeFormula
B1=MATCH(TRUE,INDEX($C1:$O1>$A1,0),)
 
Last edited:
Upvote 0
HAHA really overlooking the obvious.

thank you so much

=IFERROR(MATCH(INDEX($E1:$P1,MATCH(TRUE,INDEX($E1:$P1>$B1,0),)),E1:P1,0),0)
 
Upvote 0

Excel 2010
ABCDEFGHIJKLMNO
1256200003001100000
260935000000754500
Sheet7
Cell Formulas
RangeFormula
B1{=MATCH(TRUE,$C1:$O1>A1,0)}
Press CTRL+SHIFT+ENTER to enter array formulas.


works too
 
Upvote 0

Forum statistics

Threads
1,222,753
Messages
6,168,011
Members
452,160
Latest member
Bekerinik

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