Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 199
Default Getting rid of a VALUE error

I have a formula in a spreadsheet with several nested if statements.

Even when some of the statements should be false, a #VALUE! error earlier on
is mucking up the logical outputs.

Is there a simple way to 'isolate' such an error code so that it does not
affect subsequent logical outputs please?

Thanks,

V

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Getting rid of a VALUE error

ERROR.TYPE
http://office.microsoft.com/en-us/ex...090791033.aspx
--
David Biddulph

"Victor Delta" wrote in message
...
I have a formula in a spreadsheet with several nested if statements.

Even when some of the statements should be false, a #VALUE! error earlier
on is mucking up the logical outputs.

Is there a simple way to 'isolate' such an error code so that it does not
affect subsequent logical outputs please?

Thanks,

V



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Getting rid of a VALUE error

Post the formula with an explanation of what you're trying to do.

--
Biff
Microsoft Excel MVP


"Victor Delta" wrote in message
...
I have a formula in a spreadsheet with several nested if statements.

Even when some of the statements should be false, a #VALUE! error earlier
on is mucking up the logical outputs.

Is there a simple way to 'isolate' such an error code so that it does not
affect subsequent logical outputs please?

Thanks,

V



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 199
Default Getting rid of a VALUE error

"T. Valko" wrote in message
...
Post the formula with an explanation of what you're trying to do.

Biff

Thanks. This illustrates the problem. One of the nested if statements is the
following

=IF(FIND("GRE",A22)=1,1,0) - testing, of course, whether the first three
letters of A22 are GRE

However, for many values of A22 (including blank), the output of the formula
is #VALUE! rather than 0. And this 'upsets' the rest of the logic whose
output also then comes to #VALUE!

Regards,

V

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Getting rid of a VALUE error

=IF(FIND("GRE",A22)=1,1,0) - testing, of course, whether the first three
letters of A22 are GRE


Several ways to do this...

FIND is case sensitive so gre and GRE will not match. If no match is found
then you get the error. You can trap the error like this:

=IF(COUNT(FIND("GRE",A22)),1,0)

However, this seaches the entire string, not just the 1st 3 characters. If
you want to limit the search to just the 1st 3 characters:

=IF(LEFT(A22,3)="GRE",1,0)

However, this is not case sensitive. GRE will match gre. If you want to test
for the exact match of GRE then:

=IF(EXACT(LEFT(A22,3),"GRE"),1,0)


--
Biff
Microsoft Excel MVP


"Victor Delta" wrote in message
...
"T. Valko" wrote in message
...
Post the formula with an explanation of what you're trying to do.

Biff

Thanks. This illustrates the problem. One of the nested if statements is
the following

=IF(FIND("GRE",A22)=1,1,0) - testing, of course, whether the first three
letters of A22 are GRE

However, for many values of A22 (including blank), the output of the
formula is #VALUE! rather than 0. And this 'upsets' the rest of the logic
whose output also then comes to #VALUE!

Regards,

V





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 199
Default Getting rid of a VALUE error

"T. Valko" wrote in message
...
=IF(FIND("GRE",A22)=1,1,0) - testing, of course, whether the first three
letters of A22 are GRE


Several ways to do this...

FIND is case sensitive so gre and GRE will not match. If no match is found
then you get the error. You can trap the error like this:

=IF(COUNT(FIND("GRE",A22)),1,0)

However, this seaches the entire string, not just the 1st 3 characters. If
you want to limit the search to just the 1st 3 characters:

=IF(LEFT(A22,3)="GRE",1,0)

However, this is not case sensitive. GRE will match gre. If you want to
test for the exact match of GRE then:

=IF(EXACT(LEFT(A22,3),"GRE"),1,0)

Biff

Many thanks - that's brilliant!

V

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Getting rid of a VALUE error

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Victor Delta" wrote in message
...
"T. Valko" wrote in message
...
=IF(FIND("GRE",A22)=1,1,0) - testing, of course, whether the first three
letters of A22 are GRE


Several ways to do this...

FIND is case sensitive so gre and GRE will not match. If no match is
found then you get the error. You can trap the error like this:

=IF(COUNT(FIND("GRE",A22)),1,0)

However, this seaches the entire string, not just the 1st 3 characters.
If you want to limit the search to just the 1st 3 characters:

=IF(LEFT(A22,3)="GRE",1,0)

However, this is not case sensitive. GRE will match gre. If you want to
test for the exact match of GRE then:

=IF(EXACT(LEFT(A22,3),"GRE"),1,0)

Biff

Many thanks - that's brilliant!

V



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
Error of slope taking into account error of the data points cer144 Excel Worksheet Functions 5 July 7th 08 07:26 PM
Error: "Excel encountered an error and had to remove some formatti Carl Excel Discussion (Misc queries) 0 September 18th 06 06:39 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
I have Error 1919 Error Configuring ODBC dataSource Database Texanna1 Excel Discussion (Misc queries) 1 September 12th 06 06:35 AM


All times are GMT +1. The time now is 10:42 AM.

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

About Us

"It's about Microsoft Excel"