embedded lookup function

tuffluck

New Member
Joined
Jul 20, 2010
Messages
30
i have a setup where there is a location in one column, and a number of instances in another column. corresponding columns places the number of instances in each month thereafter. i am trying to hlookup to another page to find the location and multiply a rate on the other page times the number of instances in a month, by doing this:

=IF($C7>0,HLOOKUP($A7,Rates!$D$28:$AL$78,36,FALSE)*G7,0)

where C7 is the number of instances, A7 is the location, and G7 is the particular month.

the problem is that the column with location can select multiple locations in one worksheet. the number of instances can change in any given location. so there could be locations with instances in C8, D8, E8, F8, etc. this continues for quite some time. i know i could make the formula add each line to itself OR make each addition a separate line, but i'd like one line to show all of the associated numbers and i'm hoping surely there is a sumproduct/sumif statement would do this for me otherwise. any help?

this is what i mean by adding each statement individually:

=IF($C7>0,HLOOKUP($A7,Rates!$D$28:$AL$78,36,FALSE)*G7,0)+IF($C8>0,HLOOKUP($A8,Rates!$D$28:$AL$78,36,FALSE)*G8,0)
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,224,563
Messages
6,179,527
Members
452,923
Latest member
JackiG

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