Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
John
 
Posts: n/a
Default How To Suppres #N/A Values

I've finally worked out the formula to work, which is below

=IF(ISNA(MATCH(A2,StaffNo,0)),"Crew",INDEX(StaffGr ade,MATCH(A2,StaffNo,0)))"

However I am now trying to place the formula into some code so that it will
copy down, my formula is now what is below but I'm getting a Epected End
Statement


ActiveCell.Formula =
"=IF(ISNA(MATCH(A2,StaffNo,0)),"Crew",INDEX(StaffG rade,MATCH(A2,StaffNo,0)))
"











"John" wrote in message
...
I have the following formula which returns the value Staff or Mgr,

depending
on what each persons StaffNo is attributed under StaffGrade

=INDEX(StaffGrade,MATCH(A6,StaffNo,0))

My problem is that if the Staff number in my column does not exist ithin
StaffNo the formula above returns a #N/A, I want a work around this that

if
the StaffNo does not exists that the value returned will be Staff - is

that
possible?

Thanks





  #2   Report Post  
Ola
 
Posts: n/a
Default

John,

Your might Also find this useful:
=CALC(INDEX(StaffGrade,MATCH(A2,StaffNo,0)),"Crew" )


' Short & Fast: CALC(Expected, If_Error)
Function Calc(Expected, Optional If_Error)
Calc = Expected
If IsError(Expected) Then Calc = If_Error
End Function


Ola

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

Presumably the quotes. Try

ActiveCell.Formula =
"=IF(ISNA(MATCH(A2,StaffNo,0)),""Crew"",INDEX(Staf fGrade,MATCH(A2,StaffNo,0)
))"


--
HTH

Bob Phillips

"John" wrote in message
...
I've finally worked out the formula to work, which is below


=IF(ISNA(MATCH(A2,StaffNo,0)),"Crew",INDEX(StaffGr ade,MATCH(A2,StaffNo,0)))"

However I am now trying to place the formula into some code so that it

will
copy down, my formula is now what is below but I'm getting a Epected End
Statement


ActiveCell.Formula =

"=IF(ISNA(MATCH(A2,StaffNo,0)),"Crew",INDEX(StaffG rade,MATCH(A2,StaffNo,0)))
"











"John" wrote in message
...
I have the following formula which returns the value Staff or Mgr,

depending
on what each persons StaffNo is attributed under StaffGrade

=INDEX(StaffGrade,MATCH(A6,StaffNo,0))

My problem is that if the Staff number in my column does not exist ithin
StaffNo the formula above returns a #N/A, I want a work around this that

if
the StaffNo does not exists that the value returned will be Staff - is

that
possible?

Thanks







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
Zero values in a log chart Joelle_Smith Charts and Charting in Excel 2 May 8th 23 03:42 AM
Second serie doesn't use X-as values JackRnl Charts and Charting in Excel 1 January 20th 05 01:04 AM
project values based on other values Gabriele Excel Discussion (Misc queries) 1 January 7th 05 09:27 AM
Linked values turn to #REF! after clicking don't update John Perkins Excel Worksheet Functions 2 December 1st 04 07:53 PM
Need to sum values of columns 1 - 13 and 4 - 15 ExcelHelp Excel Worksheet Functions 1 October 27th 04 07:03 PM


All times are GMT +1. The time now is 02:05 PM.

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"