Using sum functions with Hlookup . Help Required !

tglancy

New Member
Joined
Sep 12, 2002
Messages
10
I currently have the following function code :- It works but is there a far tidier way of doing this with a SUM (or similar) function ? Many Many thanks.

=HLOOKUP("tot_prem",'Column Output'!A:BW,8,FALSE)/1000+HLOOKUP("tot_prem",'Column Output'!A:BW,9,FALSE)/1000+HLOOKUP("tot_prem",'Column Output'!A:BW,10,FALSE)/1000+HLOOKUP("tot_prem",'Column Output'!A:BW,11,FALSE)/1000+HLOOKUP("tot_prem",'Column Output'!A:BW,12,FALSE)/1000+HLOOKUP("tot_prem",'Column Output'!A:BW,13,FALSE)/1000+HLOOKUP("tot_prem",'Column Output'!A:BW,14,FALSE)/1000+HLOOKUP("tot_prem",'Column Output'!A:BW,15,FALSE)/1000+HLOOKUP("tot_prem",'Column Output'!A:BW,16,FALSE)/1000+HLOOKUP("tot_prem",'Column Output'!A:BW,17,FALSE)/1000+HLOOKUP("tot_prem",'Column Output'!A:BW,18,FALSE)/1000+HLOOKUP("tot_prem",'Column Output'!A:BW,19,FALSE)/1000
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

jimboy

Well-known Member
Joined
Apr 11, 2002
Messages
2,314
What about naming the range "column_output" and then putting in the formula;

=sum(column_output)/1000

hope this helps.
 

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,971
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
A few words describing your challenge is often very useful.

If you know where the information is, try

=SUM('Column Output'!C8:C19)/1000

If the criteria is in just one unspecified heading, try

=SUM(OFFSET('Column Output'!A1,7,MATCH("tot_prem",'Column Output'!A1:G1,0)-1,12,1))/1000
 

tglancy

New Member
Joined
Sep 12, 2002
Messages
10
Thanks Dave and Jimboy..

I should have described this further. I need to retain the hlookup facility as the 'Column Output' Worksheet is prone to change. Is there a way that I can sum the results of an HLOOKUP with less code than I specified earlier ?

Thanks again for your help.
 

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,971
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
On 2002-09-19 07:09, tglancy wrote:
Thanks Dave and Jimboy..

I should have described this further. I need to retain the hlookup facility as the 'Column Output' Worksheet is prone to change. Is there a way that I can sum the results of an HLOOKUP with less code than I specified earlier ?

Thanks again for your help.


try the Match Offset combination described above

1. with minor changes

=HLOOKUP("Tot_Prem",A1:BW2,2,0)/1000

2. VBA instead of direct formulas

etc
This message was edited by Dave Patton on 2002-09-20 07:12
 

Forum statistics

Threads
1,144,293
Messages
5,723,554
Members
422,503
Latest member
aarifmahmood

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
Top