![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Join Date: Jul 2002
Location: Chicago, Illinois
Posts: 5
|
I posted this question before, however, the response was not exactly what I needed. As I still haven't figured out a solution, I will try to post the question again, and hopefully I can explain what I am trying to do a little better.
I am trying to add the summation function to a formula that has the vlookup function within it. Here is an example: Unit 1 Unit 2 Unit 3 Unit 4 income 5 4 3 2 I am trying to add the income for each of the 4 units using the vlookup function against income. So, my formula currently is as follows: =vlookup("income",file,inc,2,false)+vlookup("income",file,inc,3,false)+vlookup("income",file,inc,4,false)+vlookup("income",file,inc,5,false) In my live file; however, excel limits how many of these you can have and I receive a message stating my formula is too long. I thought there would be a way to add the sum function to this, but I cannot seem to get it correct. Any help would be appreciated. Thanks! |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 39,503
|
Quote:
I have the impression that you could use a formula like =SUMPRODUCT((A2:A100="Income")*(B2:E100)) judging from the sample you provided. |
|
|
|
|
|
|
#3 |
|
Join Date: Jul 2002
Location: Chicago, Illinois
Posts: 5
|
The file,inc was just an example in the vlookup formula. In my file, I reference an external file to pull my data. Maybe it makes more sense to show you the exact formula I am using. Here it is...
=VLOOKUP(lookup!$B11,'July 02 YTD STAT.xls'!PL,11,FALSE) +VLOOKUP(lookup!$B11,'July 02 YTD STAT.xls'!PL,12,FALSE) +VLOOKUP(lookup!$B11,'July 02 YTD STAT.xls'!PL,13,FALSE) +VLOOKUP(lookup!$B11,'July 02 YTD STAT.xls'!PL,14,FALSE) So, I am adding the data from position 11-14 from the file named "July 02 YTD STAT", with a range name of "PL". And, what I would prefer to do is use the summation function to add these positions rather than doing it one-by-one. Thank you. |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 39,503
|
Quote:
|
|
|
|
|
|
|
#5 |
|
Join Date: Jul 2002
Location: Chicago, Illinois
Posts: 5
|
The file that I am using the vlookup function against is quite large, and I am pulling a multitude of data from it. There are about 20 columns and 500+ rows of data. The file is a download from SAP, and the rows can change from month to month if an account is added. That is why I am using the vlookup function so that my links remain in tact.
|
|
|
|
|
|
#6 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 39,503
|
Quote:
|
|
|
|
|
|
|
#7 |
|
Join Date: Aug 2002
Location: Perth, Western Australia
Posts: 358
|
Any chance of just adding a =Sum(A1:E1) [where the cell references are those columns & rows which contain the income values for each unit]formula to each row (ie. in a new column) which will add the income values for all units together - and then returning this single value with the VLOOKUP?
[ This Message was edited by: BigC on 2002-08-06 23:01 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|