Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-28-2020, 03:31 AM
albyefield albyefield is offline perform multiple operations when condition fulfilled Windows 10 perform multiple operations when condition fulfilled Office 2016
Novice
perform multiple operations when condition fulfilled
 
Join Date: Jul 2012
Location: Exeter
Posts: 27
albyefield is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 05-28-2020, 09:04 AM
Logit Logit is online now perform multiple operations when condition fulfilled Windows 10 perform multiple operations when condition fulfilled Office 2007
Expert
 
Join Date: Jan 2017
Posts: 529
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Look at the LEFT and the MID functions for use in an Excel Formula.
Reply With Quote
  #3  
Old 05-28-2020, 10:33 AM
albyefield albyefield is offline perform multiple operations when condition fulfilled Windows 10 perform multiple operations when condition fulfilled Office 2016
Novice
perform multiple operations when condition fulfilled
 
Join Date: Jul 2012
Location: Exeter
Posts: 27
albyefield is on a distinguished road
Default

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
Reply With Quote
  #4  
Old 05-28-2020, 10:36 AM
Logit Logit is online now perform multiple operations when condition fulfilled Windows 10 perform multiple operations when condition fulfilled Office 2007
Expert
 
Join Date: Jan 2017
Posts: 529
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

You are welcome.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
perform multiple operations when condition fulfilled Order of Operations in Word tg2018_ Mail Merge 2 08-23-2018 09:59 AM
perform multiple operations when condition fulfilled 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 multiple operations when condition fulfilled Perform Calculations using List boxes Jennifer_Falcon Word VBA 6 07-26-2011 10:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft