R
Rob
Excel 2000
I have a text list in column B that I need to loop through and if a certain
criteria is met, action taken. My issue is that the criteria is complex (or
at least I think it is).
The list in column B can be any number of rows from 2 to 20,000. An example
of the kind of data is shown below, some rows begin with a number and to
confuse things, they also start with a space before the number. What I need
to do is replace the entry with only the text from each row eg. 75 Total
Sales becomes Total Sales whereas Sales at retail Price remains the same.
BEFORE EXAMPLE
75 Total Sales
113 Wholesale Rounds
114 Cat food
115 Cat litter
16 Other item
Sales at Retail Price
Net sales at Wholesale
AFTER EXAMPLE
Total Sales
Wholesale Rounds
Cat food
Cat litter
Other item
Sales at Retail Price
The formula below achieves what's required except I'm importing the
information and need to automate the cleaning process of data at the point
of import.
=TRIM(IF(ISNUMBER(VALUE(MID(B5,2,SEARCH(" "&"*"&"
",B5,2)-2))),RIGHT(B5,LEN(B5)-SEARCH(" "&"*"&" ",B5,2)),B5))
Any pointers most welcome. Rob
I have a text list in column B that I need to loop through and if a certain
criteria is met, action taken. My issue is that the criteria is complex (or
at least I think it is).
The list in column B can be any number of rows from 2 to 20,000. An example
of the kind of data is shown below, some rows begin with a number and to
confuse things, they also start with a space before the number. What I need
to do is replace the entry with only the text from each row eg. 75 Total
Sales becomes Total Sales whereas Sales at retail Price remains the same.
BEFORE EXAMPLE
75 Total Sales
113 Wholesale Rounds
114 Cat food
115 Cat litter
16 Other item
Sales at Retail Price
Net sales at Wholesale
AFTER EXAMPLE
Total Sales
Wholesale Rounds
Cat food
Cat litter
Other item
Sales at Retail Price
The formula below achieves what's required except I'm importing the
information and need to automate the cleaning process of data at the point
of import.
=TRIM(IF(ISNUMBER(VALUE(MID(B5,2,SEARCH(" "&"*"&"
",B5,2)-2))),RIGHT(B5,LEN(B5)-SEARCH(" "&"*"&" ",B5,2)),B5))
Any pointers most welcome. Rob