Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 84
Default Code required for VLookup returning #NA

Hi Super clever coders
I would love to have some VB code that I could put into a spreadsheet (or
another clever way to do this) that will return a 0 whenever a VLOOKUP
formula returns a vaue of #N/A. I use VLOOPUP to return values into a column
which is then totalled using sum or subtotal, but these formulas won't work
because of the #N/As returned.
Any help woul dbe much appreceiated.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Code required for VLookup returning #NA

Marie -

Try something like this:

=IF(ISNA(<lookup formula),<value to return if N/A,<lookup formula)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Marie Bayes" wrote in message
...
Hi Super clever coders
I would love to have some VB code that I could put into a spreadsheet (or
another clever way to do this) that will return a 0 whenever a VLOOKUP
formula returns a vaue of #N/A. I use VLOOPUP to return values into a
column
which is then totalled using sum or subtotal, but these formulas won't
work
because of the #N/As returned.
Any help woul dbe much appreceiated.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 84
Default Code required for VLookup returning #NA

I've tried this but for some reason it's not liked, it doesn't like the value
I'm trying to return if NA (which is 0, so nothing too complicated), could I
be doing something very wrong, this is the formula as I've typed it..
=IF(ISNA(VLOOKUP($E7,'[lead gen campaign cumulative january by source
code.xls]Sheet1'!$A:$G,3,FALSE),0,VLOOKUP($E7,'[lead gen campaign cumulative
january by source code.xls]Sheet1'!$A:$G,3,FALSE)

"Jon Peltier" wrote:

Marie -

Try something like this:

=IF(ISNA(<lookup formula),<value to return if N/A,<lookup formula)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Marie Bayes" wrote in message
...
Hi Super clever coders
I would love to have some VB code that I could put into a spreadsheet (or
another clever way to do this) that will return a 0 whenever a VLOOKUP
formula returns a vaue of #N/A. I use VLOOPUP to return values into a
column
which is then totalled using sum or subtotal, but these formulas won't
work
because of the #N/As returned.
Any help woul dbe much appreceiated.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 84
Default Code required for VLookup returning #NA

Sorry, don't know if you can still help, I've amended the formula from my
last reply to this (there was a close bracket missing): it now appears to
work but returns the wrong value:
=IF(ISNA(VLOOKUP($E7,'[lead gen campaign cumulative january by source
code.xls]Sheet1'!$A:$G,3,FALSE)),0,VLOOKUP($E7,'[lead gen campaign cumulative
january by source code.xls]Sheet1'!$A:$G,3,FALSE))

"Jon Peltier" wrote:

Marie -

Try something like this:

=IF(ISNA(<lookup formula),<value to return if N/A,<lookup formula)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Marie Bayes" wrote in message
...
Hi Super clever coders
I would love to have some VB code that I could put into a spreadsheet (or
another clever way to do this) that will return a 0 whenever a VLOOKUP
formula returns a vaue of #N/A. I use VLOOPUP to return values into a
column
which is then totalled using sum or subtotal, but these formulas won't
work
because of the #N/As returned.
Any help woul dbe much appreceiated.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 84
Default Code required for VLookup returning #NA

Ignore all previous, i#ve corrected my stupid mistakes and now it all works
perfectly, thanks so much.

"Jon Peltier" wrote:

Marie -

Try something like this:

=IF(ISNA(<lookup formula),<value to return if N/A,<lookup formula)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Marie Bayes" wrote in message
...
Hi Super clever coders
I would love to have some VB code that I could put into a spreadsheet (or
another clever way to do this) that will return a 0 whenever a VLOOKUP
formula returns a vaue of #N/A. I use VLOOPUP to return values into a
column
which is then totalled using sum or subtotal, but these formulas won't
work
because of the #N/As returned.
Any help woul dbe much appreceiated.






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Code required for VLookup returning #NA

Make sure that calculation is set to automatic--just in case.
Tools|options|calculation tab

But then look at your data once more. I bet you'll find that match earlier than
you think--maybe on a hidden row???

Marie Bayes wrote:

Sorry, don't know if you can still help, I've amended the formula from my
last reply to this (there was a close bracket missing): it now appears to
work but returns the wrong value:
=IF(ISNA(VLOOKUP($E7,'[lead gen campaign cumulative january by source
code.xls]Sheet1'!$A:$G,3,FALSE)),0,VLOOKUP($E7,'[lead gen campaign cumulative
january by source code.xls]Sheet1'!$A:$G,3,FALSE))

"Jon Peltier" wrote:

Marie -

Try something like this:

=IF(ISNA(<lookup formula),<value to return if N/A,<lookup formula)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Marie Bayes" wrote in message
...
Hi Super clever coders
I would love to have some VB code that I could put into a spreadsheet (or
another clever way to do this) that will return a 0 whenever a VLOOKUP
formula returns a vaue of #N/A. I use VLOOPUP to return values into a
column
which is then totalled using sum or subtotal, but these formulas won't
work
because of the #N/As returned.
Any help woul dbe much appreceiated.





--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 84
Default Code required for VLookup returning #NA

Thanks Dave, as you might have noticed, all was present and correct and it
was just me making a mistake!

"Dave Peterson" wrote:

Make sure that calculation is set to automatic--just in case.
Tools|options|calculation tab

But then look at your data once more. I bet you'll find that match earlier than
you think--maybe on a hidden row???

Marie Bayes wrote:

Sorry, don't know if you can still help, I've amended the formula from my
last reply to this (there was a close bracket missing): it now appears to
work but returns the wrong value:
=IF(ISNA(VLOOKUP($E7,'[lead gen campaign cumulative january by source
code.xls]Sheet1'!$A:$G,3,FALSE)),0,VLOOKUP($E7,'[lead gen campaign cumulative
january by source code.xls]Sheet1'!$A:$G,3,FALSE))

"Jon Peltier" wrote:

Marie -

Try something like this:

=IF(ISNA(<lookup formula),<value to return if N/A,<lookup formula)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Marie Bayes" wrote in message
...
Hi Super clever coders
I would love to have some VB code that I could put into a spreadsheet (or
another clever way to do this) that will return a 0 whenever a VLOOKUP
formula returns a vaue of #N/A. I use VLOOPUP to return values into a
column
which is then totalled using sum or subtotal, but these formulas won't
work
because of the #N/As returned.
Any help woul dbe much appreceiated.




--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Code required for VLookup returning #NA

Your other post hadn't arrived through the internets to me--I think the tubes
were clogged!

Marie Bayes wrote:

Thanks Dave, as you might have noticed, all was present and correct and it
was just me making a mistake!

"Dave Peterson" wrote:

Make sure that calculation is set to automatic--just in case.
Tools|options|calculation tab

But then look at your data once more. I bet you'll find that match earlier than
you think--maybe on a hidden row???

Marie Bayes wrote:

Sorry, don't know if you can still help, I've amended the formula from my
last reply to this (there was a close bracket missing): it now appears to
work but returns the wrong value:
=IF(ISNA(VLOOKUP($E7,'[lead gen campaign cumulative january by source
code.xls]Sheet1'!$A:$G,3,FALSE)),0,VLOOKUP($E7,'[lead gen campaign cumulative
january by source code.xls]Sheet1'!$A:$G,3,FALSE))

"Jon Peltier" wrote:

Marie -

Try something like this:

=IF(ISNA(<lookup formula),<value to return if N/A,<lookup formula)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Marie Bayes" wrote in message
...
Hi Super clever coders
I would love to have some VB code that I could put into a spreadsheet (or
another clever way to do this) that will return a 0 whenever a VLOOKUP
formula returns a vaue of #N/A. I use VLOOPUP to return values into a
column
which is then totalled using sum or subtotal, but these formulas won't
work
because of the #N/As returned.
Any help woul dbe much appreceiated.




--

Dave Peterson


--

Dave Peterson
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
Code to prevent Remove Split or Unfreeze Panes? dk_ Excel Discussion (Misc queries) 6 October 9th 06 08:35 PM
Text formatting Kace Excel Worksheet Functions 1 September 18th 06 08:28 PM
Returning To Previous Worksheet - Help with sebastienm's code AcesUp Excel Discussion (Misc queries) 0 June 3rd 06 12:47 PM
Complicated If Then / V Lookup / Match Statement... ryesworld Excel Worksheet Functions 17 December 10th 05 02:09 PM
t-distribution puzzle in Excel [email protected] Excel Discussion (Misc queries) 8 November 11th 05 10:27 AM


All times are GMT +1. The time now is 07: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"