Need to find corresponding row 0 value in the header C2:K2

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,422
Office Version
  1. 2010
I need a formula or VBA, which can find corresponding row 0 value in the header C2:K2 and result in the column M</SPAN></SPAN>

For an example...
</SPAN></SPAN>
Of the row 8 cell F8=0 so the value of header C2:K2 F2=4 result in the column M8=4
</SPAN></SPAN>
Of the row 9 cell I9=0 so the value of header C2:K2 I2=7 result in the column M9=8.... and so on
</SPAN></SPAN>

Here is an example data....
</SPAN></SPAN>


Book1
ABCDEFGHIJKLM
1
2123456789
3
4
5n1n2n3n4n5n6n7n8n9RESULT
6111111111
7222222222
83330133334
94441240447
105052351552
116163402666
127270513774
138081624882
140192735991
151010384610102
162111095711114
1702121106812121
1803132117913131
19141401281014147
20051511391115151
210616214101216161
22171731511017177
23081841612118181
24191901713219194
250102011814320201
261112101915421214
27212012016522223
28013122117623231
29014232218724241
30015342319825251
31016452420926261
322051337727142
33316240828156
3442735190168
35038462101171
36149570112186
37251068112309
38361170213415
3947128130527
405809241633
4160110352742
4271211403856
4382012514963
4493106251074
4510421736088
4611530847194
Sheet2


Thank you all
</SPAN></SPAN>

Excel 2000
</SPAN></SPAN>
Regards,
</SPAN></SPAN>
Moti
</SPAN></SPAN>
 
Last edited:

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Try this option with array formula in M6 an copy down:

{=IFERROR(INDEX($C$2:$K$2,0,MAX(IF(C6:K6=0,COLUMN(C6:K6)))-2),"")}

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Another option with regular formula.

=SUMPRODUCT((C6:K6=0)*($C$2:$K$2))

But if there is no 0, a 0 returns.
 
Upvote 0
Solution
Try this option with array formula in M6 an copy down:

{=IFERROR(INDEX($C$2:$K$2,0,MAX(IF(C6:K6=0,COLUMN(C6:K6)))-2),"")}

<TBODY>
</TBODY>


<TBODY>
</TBODY>
DanteAmor, This formula has "IFERROR" function, which is not compatible with excel 2000.

Another option with regular formula.

=SUMPRODUCT((C6:K6=0)*($C$2:$K$2))

But if there is no 0, a 0 returns.
This regular "SUMPRODUCT" formula worked like a charm no problem if result returns 0 in case there is no zero in the row</SPAN></SPAN>

Thank you DanteAmor, for your kind help
</SPAN></SPAN>

Kind Regards
</SPAN></SPAN>
Moti :-D
</SPAN></SPAN>
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,194
Members
452,616
Latest member
intern444

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