Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Trying to use IF statement with hyphen

I"m struggling with trying to get this function to work.
=IF((LEFT(Data!$I$2,3))="-","",((Data!$I$2)))

If the third character is a hyphen, I want the data in the cell to be blank
otherwise, I want the value of I2 in that cell.

Any ideas?
Amy
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Trying to use IF statement with hyphen

Maybe...

=if(mid(data!$i$2,3,1)="-","",data!$i$2)

AmytDev wrote:

I"m struggling with trying to get this function to work.
=IF((LEFT(Data!$I$2,3))="-","",((Data!$I$2)))

If the third character is a hyphen, I want the data in the cell to be blank
otherwise, I want the value of I2 in that cell.

Any ideas?
Amy


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Trying to use IF statement with hyphen

1. Too many parenthesis
2. LEFT will return what's left of the 3rd character the 3rd character
included
3. What do you want if the I2 is empty?

try

=IF(MID(Data!$I$2,3,1)="-","",Data!$I$2)


if you want a blank if I2 is empty

=IF(OR($I$2="",MID(Data!$I$2,3,1)="-"),"",Data!$I$2)


--
Regards,

Peo Sjoblom



"AmytDev" wrote in message
...
I"m struggling with trying to get this function to work.
=IF((LEFT(Data!$I$2,3))="-","",((Data!$I$2)))

If the third character is a hyphen, I want the data in the cell to be
blank
otherwise, I want the value of I2 in that cell.

Any ideas?
Amy



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Trying to use IF statement with hyphen

That was awesome! This worked out perfectly. Thank you so Much!
Amy

"Peo Sjoblom" wrote:

1. Too many parenthesis
2. LEFT will return what's left of the 3rd character the 3rd character
included
3. What do you want if the I2 is empty?

try

=IF(MID(Data!$I$2,3,1)="-","",Data!$I$2)


if you want a blank if I2 is empty

=IF(OR($I$2="",MID(Data!$I$2,3,1)="-"),"",Data!$I$2)


--
Regards,

Peo Sjoblom



"AmytDev" wrote in message
...
I"m struggling with trying to get this function to work.
=IF((LEFT(Data!$I$2,3))="-","",((Data!$I$2)))

If the third character is a hyphen, I want the data in the cell to be
blank
otherwise, I want the value of I2 in that cell.

Any ideas?
Amy




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Optional hyphen? Eric Excel Discussion (Misc queries) 4 October 19th 06 01:31 AM
Copy Text to Right of Hyphen ConfusedNHouston Excel Discussion (Misc queries) 3 July 27th 06 07:25 PM
...I want to display a hyphen instead of zero... Dr. Darrell Excel Worksheet Functions 2 August 1st 05 01:18 PM
Need to remove hyphen in group of #s [email protected] Excel Discussion (Misc queries) 2 March 2nd 05 02:04 PM
sort cells with hyphen #####-###-#### bagman Excel Discussion (Misc queries) 6 January 1st 05 07:05 PM


All times are GMT +1. The time now is 03:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"