Locate 1st column that does not contain A, B or C

Glen_Marshall

New Member
Joined
May 6, 2014
Messages
9
Hi all,

I have a spread sheet with c.20k rows of data with 8 columns in the following format:

Comp1 Cost1 Comp2 Cost2 Comp3 Cost3 Comp4 Cost4

Under the Comp columns there are multiple (c.100) codes.

I'm trying to locate (for each line) the 1st 'Comp' column that does not contain U7,UN or UI. Once I can locate this column then I can extract the Cost associated to that Comp.

Bit of background, companies U7, UN and UI will soon not be available so I want to locate the next cost

Hope this makes sense, I've tried various options but cannot find anything to find where it's not equal to a set of characters.

All help / advice gratefully received.

Regards

Glen
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Re: How to locate 1st column that does not contain A, B or C

Assuming the 'Comp' values are text and the 'Cost' values are numerical, would this work for you?
If not,please give added requirements.


Book1
ABCDEFGHIJK
1Comp1Cost1Comp2Cost2Comp3Cost3Comp4Cost4CompCost
2AB3U74UN2CD6AB3
3U78UI22UN3
4U79UI23UN4XZ3XZ3
5UI5XXX100ABC99XXX100
Locate cost
Cell Formulas
RangeFormula
J2=IFERROR(INDEX(A2:H2,AGGREGATE(15,6,(COLUMN(A2:H2)-COLUMN(A2)+1)/((ISTEXT(A2:H2))*(ISERROR(FIND(A2:H2,"U7UNUI")))),1)),"")
K2=IF(J2="","",INDEX(B2:H2,MATCH(J2,A2:G2,0)))
 
Upvote 0
Re: How to locate 1st column that does not contain A, B or C

Thank you so much, 100% spot on!!!

Looks like I have a new function to learn of Aggregate, thanks again!!!
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,259
Members
452,626
Latest member
huntinghunter

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