#1
|
|||
|
|||
perform multiple operations when condition fulfilled
Hi
I have a situation where a column is occupied by a 1 to 3 digit integer but may have or not have multiple characters "i" appended .I wish to return 2 more columns 1 with the no from the first column and the other a string showing the appended "i"s I managed it using VBA as follows Sub testerlatest() Dim a As String Dim b As String Dim c As String n = 2 Do While Cells(n, 1) <> "" b = "" c = "i" a = Cells(n, 1) i = Len(a) Do While Right(a, 1) = "i" i = i - 1 b = b & c a = Left(a, i) Loop Cells(n, 3) = a Cells(n, 2) = b n = n + 1 Loop End Sub But have been trying to solve the problem without resorting to VBA my problem is that I can’t find a way of doing more than one operation when a condition is true, easy enough to test more than on condition but --- Any ideas please Albie |
#2
|
|||
|
|||
Look at the LEFT and the MID functions for use in an Excel Formula.
|
#3
|
|||
|
|||
Thank you problem now solved
here is the solution giving results in columns D & E =IF(ISERROR(FIND("i",A2)),A2,LEFT(A2,FIND("i",A2)-1)) =IF(A2<>D2,RIGHT(A2,LEN(A2)-LEN(D2)),"") Thanks for the hint |
#4
|
|||
|
|||
You are welcome.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Order of Operations in Word | tg2018_ | Mail Merge | 2 | 08-23-2018 09:59 AM |
Search text using logical operations? | paik1002 | Word | 1 | 02-21-2016 11:48 PM |
specifying sender account for mail merge operations | eNGiNe | Mail Merge | 3 | 12-19-2014 04:24 AM |
HELP - SUMIF more than 3 conditions + operations in the sum | romelsms123 | Excel | 0 | 06-23-2014 09:59 AM |
Perform Calculations using List boxes | Jennifer_Falcon | Word VBA | 6 | 07-26-2011 10:49 AM |