HLOOKUP to return entire sum of column

Julesdude

Board Regular
Joined
Jan 24, 2010
Messages
197
Hi there. I need help trying to create a simple(ish) forumula. One cell needs to have a formula that uses the HLOOKUP function for range V3:AK3. But what I want it to return is not the value of a particular cell but the sum of the entire column that is identified in this HLOOKUP range.

I also need to trap any errors so if a value is 0 or is an error, to just display a blank.

Can anyone please help?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Do you need to identify the relevant column the same way that HLOOKUP does, by reference to the values in the first row ?
 
Upvote 0
INDIRECT should solve this, either by itself (e.g. with a named range), or in combination with a lookup table
 
Upvote 0
And in case the lookup value isn't found:

=IF(COUNTIF(lookup_val,$V$3:$AK$3),SUM(INDEX($V:$AK,0,MATCH(lookup_val,$V$3:$AK$3,0))),"")
 
Upvote 0
Thanks everyone for the input. I've tried using the examples but it's not returning the correct values and I think there may be a problem using the COUNTIF to return a blank if false -it will always return true because it is guaranteed that the number of occurances will be greater than 0.

I'll try and make what I need clearer. I have cell D44. I need to use the value in cell B44 to search for the same value in a range. That range is J3:EQ3 (these are column references for a table). When it finds this match, I need that entire column totaled and that total returned back to original cell D44, that I am writing the formula in.

If the value returned is 0 or an error, then D44 must be blank.
 
Upvote 0
Hi Gerald. It will appear anywhere in the range J3:EQ3. So if cell B44 has "Hello" written in it then it needs to find "hello" in that range and use the column it's in as an index to total every value in that column.

So if it finds "hello" in L3, it then needs to SUM L4:L65536, returning the value back to D44.
 
Upvote 0
I still think my suggestion works. Here's an example.
Excel Workbook
ABCDE
1Lookup Valabc
2Result5674
3
4aababcabcdabcde
5499360240407843
6423955435956312
7257254364456932
863564102372747
9630592801484127
102074343596972
11649333989536700
12780393542138617
13447610275142248
1415596451339734
15626938151602360
16588581787646501
Sheet1
Excel 2010
Cell Formulas
RangeFormula
B2=IF(COUNTIF(A4:E4,B1),SUM(INDEX($B:$F,0,MATCH(B1,$A$4:$E$4,0))))
 
Upvote 0
Apologies, error in my previous sample. Please refer to this one:
Excel Workbook
ABCDE
1Lookup Valabc
2Result5180
3
4aababcabcdabcde
5499360240407843
6423955435956312
7257254364456932
863564102372747
9630592801484127
102074343596972
11649333989536700
12780393542138617
13447610275142248
1415596451339734
15626938151602360
16588581787646501
Sheet1
Excel 2010
Cell Formulas
RangeFormula
B2=IF(COUNTIF($A$4:$E$4,$B$1),SUM(INDEX($A:$E,0,MATCH($B$1,$A$4:$E$4,0))),"")
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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