Using Vlookup to add up several rows

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I need to look up various types of Depreciation , where the values are in column 105 (Col DL) and the decriptions are in col L

I have tried to use the following formula to add all the various depreciation types in Col 105, but cannot get it to add the values


=IF(A69=(RIGHT(A69,50)),VLOOKUP("*Depreciation*",Sheet1!$L$1512:$DL$1783,105,FALSE))

The various types of depreciation are:

DEPRECIATION-COMPUTER EQUIP
DEPRECIATION Corp Signage
DEPRECIATION-P & M
DEPRECIATION-F & F
DEPRECIATION-OE

your assistance will be most appreciated
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi Robert

Thanks for the help. The formula works perfectly. However, the values must allways refer to Col DL. Each month a new col is inserted and the values are copied into Col DL. How do I overcome this?
 
Upvote 0
Hi Robert

Thanks for the help. The formula works perfectly. However, the values must allways refer to Col DL. Each month a new col is inserted and the values are copied into Col DL. How do I overcome this?

Try...

=SUMIF(L1512:L1783,"*DEPRECIATION*",INDIRECT("DL1512:DL1783"))
 
Upvote 0
Hi Aladin

Thanks for the help, which is much appreciated. What is the purpose of the indirect function i.e how does it work?

Regards

Howard
 
Upvote 0
Hi Aladin

Thanks for the help, which is much appreciated. What is the purpose of the indirect function i.e how does it work?

Regards

Howard

The string it embeds cannot change during copying, etc. INDIRECT resoves the range behind that unchanging string. This enables us to anchor the reference into a fixed address.
 
Upvote 0
Hi Aladin

Thanks for the explanation.
 
Upvote 0
Hi Aladin
i want to ask u
when i remove the " " from Indirect function it is return Error , why ?
Code:
=SUMIF($L$1512:$L$1521,"*DEPRECIATION*",INDIRECT(DL1512:DL1521))
 
Upvote 0
Hi Aladin
i want to ask u
when i remove the " " from Indirect function it is return Error , why ?
Code:
=SUMIF($L$1512:$L$1521,"*DEPRECIATION*",INDIRECT(DL1512:DL1521))

INDIRECT expects a string, not a range. Thus, this function resolves a string to a range whose values it makes available. When given a range, it has nothing to resolve, hence the error.
 
Upvote 0

Forum statistics

Threads
1,214,411
Messages
6,119,346
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top