Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-01-2018, 08:23 AM
14spar15 14spar15 is offline Using IF ISBLANK with formula Windows 7 64bit Using IF ISBLANK with formula Office 2010 64bit
Advanced Beginner
Using IF ISBLANK with formula
 
Join Date: Mar 2011
Posts: 97
14spar15 is on a distinguished road
Default Using IF ISBLANK with formula


I have this formula.

=IF(ISERROR(FIND(" ",C2,FIND(" ",C2,1)+1)),C2,LEFT(C2,FIND(" ",C2,FIND(" ",C2,1)+1))) & RIGHT(C2,LEN(C2)-FIND("-",C2))

If there is no data in C2 I want it to return a blank cell and not #VALUE! I have seen IF ISBLANK used and a few other methods but I can’t figure out how to apply it to my formula. Thanks
Reply With Quote
  #2  
Old 11-01-2018, 10:30 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Using IF ISBLANK with formula Windows 7 64bit Using IF ISBLANK with formula Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Hello
as this is your 26th post you should know on which forum to post.
I will move it to the correct subforum
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 11-01-2018, 08:19 PM
Marcia's Avatar
Marcia Marcia is offline Using IF ISBLANK with formula Windows 7 32bit Using IF ISBLANK with formula Office 2007
Expert
 
Join Date: May 2018
Location: Philippines
Posts: 527
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default

Quote:
Originally Posted by 14spar15 View Post
I have this formula.

=IF(ISERROR(FIND(" ",C2,FIND(" ",C2,1)+1)),C2,LEFT(C2,FIND(" ",C2,FIND(" ",C2,1)+1))) & RIGHT(C2,LEN(C2)-FIND("-",C2))

If there is no data in C2 I want it to return a blank cell and not #VALUE! I have seen IF ISBLANK used and a few other methods but I can’t figure out how to apply it to my formula. Thanks
how about this:
=IF(C2="","",FIND.....................
Reply With Quote
  #4  
Old 11-02-2018, 12:32 AM
ArviLaanemets ArviLaanemets is offline Using IF ISBLANK with formula Windows 8 Using IF ISBLANK with formula Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

Probably you'll have explain what you formula must do, and which kind of entry you except in C2.

Better use IFERROR()!
Generally the syntax to use IFERROR() is like
Code:
=IFERROR(YourExpression,ExpressionForError)
Like the formula
Code:
=IFERROR(LEFT(C2,FIND(" ",C2,1)-1),C2)
returns contents of C2 until 1st space, or the whole entry in C2, when there is no space.

You check in your formula for 2 spaces in C2 entry, and it looks like you want to return all left from 2nd space. And it looks like you want to concatenate this with all right at character "-" in end of entry in C2. This means, that there can be at least 3 different reasons the formula can result as error:
1. There is no space in entry;
2. There is only one space in entry;
There is no "-" in entry.

The formula you need will depend on conditions you apply to entry in C2.

When the valid entry will always have at least 2 spaces, and "-" in it at any position, you can simply use SUBSTITUTE() with LEN() to determine validity of entry (When checking for existence of double space, you can ensure the valid entry has 2 spaces at different locations. You also have to decide, is more than 2 spaces allowed. And what about having more than one "-". And probably you have to check that "-" is at right from both spaces).

When the structure of valid entry is not so strictly defined, you probably need IFERROR() applied at several levels of formula (What to return when no space is present in entry, what to return, when only one space is present, what to return when no "-" is present).
Reply With Quote
  #5  
Old 11-02-2018, 01:30 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Using IF ISBLANK with formula Windows 7 64bit Using IF ISBLANK with formula Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

@Arvi
Looks like in this case the IF(ISERROR syntax is the way to go
The OP formula states that if the first FIND returns an error, it returns C2
If not it returns the concatenation.
IFERROR will not cope with this.
@14spar
Try adding=IF(C2="","",IF(Iserror....
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #6  
Old 11-02-2018, 05:02 AM
14spar15 14spar15 is offline Using IF ISBLANK with formula Windows 7 64bit Using IF ISBLANK with formula Office 2010 64bit
Advanced Beginner
Using IF ISBLANK with formula
 
Join Date: Mar 2011
Posts: 97
14spar15 is on a distinguished road
Default

Hey guys, thanks for all the great input here. Sorry for originally posting this in the wrong forum. I was originally thinking that formulas might somehow be associated with Excel Programming. I first tried Marcia’s approach and it failed. After reading ArviLaanemets informative bit on how the IFError works I’m thinking it maybe failed because there are provisions in my formula for errors. I used this formula with the ISERROR provisions because it was the only one I could find that was close to what I was trying to do. I try and dissect the formulas to see just how they’re working and it seems I should stay away from the IF/IS ERROR till I have a better basic understanding of how these formals work. For now Pecoflyer’s solution has solved the problem. I had seen this =IF(C2="","".. approach used in this forum but not with the “IF” statements and when I tried it earlier apparently I had applied it incorrectly. Thanks again for the help here.
Reply With Quote
  #7  
Old 11-02-2018, 05:47 AM
ArviLaanemets ArviLaanemets is offline Using IF ISBLANK with formula Windows 8 Using IF ISBLANK with formula Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

With using ISERROR(), and checking both parts of your function, the possible solution may be (be careful to keep relative/absolute references correct):
1. Activate any cell in row 2 and define a dynamic Name (I assume the sheet name is Sheet1), e.g.
Code:
nDynamicName1 = LEFT(Sheet1!$C2,FIND(" ",Sheet1!$C2,FIND(" ",Sheet1!$C2,1)+1))
;
2. Remain in row 2 and define another dynamic Name, e.g.
Code:
nDynamicName2 = RIGHT(Sheet1!$C2,LEN(Sheet1!$C2)-FIND("-",Sheet1!$C2))
;
To return empty string whenever C2 is empty, C2 whenever nDynamicName1 or nDynamicName2 returns an error, and your formula result otherwise, the formula in any column of row 2 will be
Code:
="" & IF(OR(ISERROR(nDynamicName1),ISERROR(nDynamicName2)),$C2,nDynamicName1 & nDynamicName2)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula Copy Row 2 Row But Next Column In Formula From Another Tab TimG Excel 3 04-16-2018 09:20 PM
Using IF ISBLANK with formula Possible to use an existing vlookup formula to also insert correct info and trigger a SUM formula innkeeper9 Excel 2 09-13-2016 08:59 PM
Help With a Formula OTPM Excel 3 05-26-2016 03:42 AM
Need help with dragging a formula and changing a reference column as I drag the formula. LupeB Excel 1 10-22-2015 03:02 PM
Using IF ISBLANK with formula Help with formula please. AndrewSE Excel 3 04-05-2011 08:50 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:56 PM.


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