Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 8th, 2004, 11:29 AM
Authorized User
 
Join Date: Oct 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to SiliconFuRy
Default SUM with formula values

Seasons shoes,

I have a friend who has bit of a prob....

He has a column of values that are calculated from VLOOKUPs, and he wants to do a SUM() on this column, but just a basic SUM returns #N/A, im guessing because the columns have formulas and not values in them.

Any idea how to calculate the sum of a column of formulas?

Thanks in Advance!

Many shoes,

Jamez/SiliconFuRy
__________________
Many shoes,

Jamez/SiliconFuRy
 
Old December 9th, 2004, 08:25 AM
Authorized User
 
Join Date: Aug 2004
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think that it is more likely that there is at least one #N/A in the column where the VLOOKUP() has not found a value.

If non-matches are expected then the following method puts zero instead :-
=IF(ISERROR(VLOOKUP(A1,Sheet1!$A$1:$B$15,2,FALSE)) ,0,VLOOKUP(A1,Sheet1!$A$1:$B$15,2,FALSE))




-----------------------
Regards BrianB
Most problems occur from starting at the wrong place.
Use a cup of coffee to make Windows run faster.
It is easy until you know how.
 
Old December 9th, 2004, 08:49 AM
Authorized User
 
Join Date: Oct 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to SiliconFuRy
Default

So you're saying that if the column with vlookups has values in it (no #N/As) then the SUM should work?

Thanks for the code snippet ;)

Many shoes,

Jamez/SiliconFuRy
 
Old January 7th, 2005, 08:17 AM
Authorized User
 
Join Date: Jan 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

And if you wish to have the sum working without having to change vlookup formula, Instead of SUM just use Sumif (as follows)
(Range_of_cells_containing_values_amd_NA,Criteria)

Where Criteria = "<>#N/A"

Regards
Amjad






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get the Sum of all the values in a column.. jhansib4u ADO.NET 1 December 1st, 2007 09:15 PM
how can find Sum of all book values where BookType Rg2005 SQL Server 2000 2 October 8th, 2007 03:03 AM
Sum Textbox Values Snuffles ASP.NET 2.0 Basics 1 April 13th, 2007 01:36 PM
Need help to write codes to sum values sunny76 Excel VBA 1 July 6th, 2005 05:05 AM
Sum values by key Justine Oracle 1 April 28th, 2004 03:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.