Indexing value from non adjacent

mart_mrexcel

Active Member
Joined
Aug 23, 2008
Messages
310
Office Version
  1. 365
Platform
  1. Windows
In the given table below, starting from I2 cell, i want to get the first Spvsr Position code starting from the right (A1, C1, E1,G1).
In I2 the expected value is 50087936 and in I3 the expected value 50087936 (excluding the cell value with "---")
In J2, i need to get the second value and
in K2, i need to get the third value.

ABCDEFGHI
1Spvsr 1 CodeSpvr 1 PositionSpvsr 2 CodeSpvsr 2 PositionSpvsr 3 CodeSpvsr 3 PositionSpvsr 4 CodeSpvsr 4 Position
250094562S. Head50086819Mgr50087936GM------
350086819Mgr50087936GM---
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
In I2:
Excel Formula:
=CHOOSECOLS(SUBSTITUTE(A2:H3,"---",""),SEQUENCE(1,4,1,2))
of course instead of H3 use a real bottom cell address
 
Upvote 0
Solution
Try. In I2. This will give only Sup Numbers.
Excel Formula:
=TEXTSPLIT(TEXTJOIN(",",0,BYROW(SUBSTITUTE(B2:H3,"---",""),LAMBDA(r,TEXTJOIN("_",0,IFERROR(INDEX(r,LARGE(IF(r<>"",COLUMN(B1:H1)-COLUMN($A$1),""),{2,4,6})),""))))),"_",",",0,1,"")
 
Last edited:
Upvote 0
Glad it worked for you and thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,932
Messages
6,175,468
Members
452,646
Latest member
tudou

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