vlookup with conditions

rdev

Active Member
Joined
Dec 3, 2007
Messages
273
See the table below
Month Acc_code Amount
Jan-11 OP1102 5000
Jan-11 OP1105 4000
Jan-11 OP1108 3000
Jan-11 OP1109 2000
Jan-11 OP1201 -14000
Feb-11 OP1102 -13999
Feb-11 OP1108 -13998
Feb-11 OP1105 -13997

I have the table above in column A , the month , column B , the Acc-code and column C the Amount. I am trying a vlookup to work such that say if cell I5 = Cell A1 , then vlookup will concatenate OP with 1102 and return value in A3 above, if Feb 11 is in cell I5 , then lookup will concatenate to 1102 to return value -13999. I will then drag and drop formula over a range .

Jan-11( Cell I5)
OP
1102 0
1108 0
1201 0

Any clue how i can achieve this??
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi rdev,

The only way to achieve what you want using lookups is to use dynamic ranges, however, IF you only have one instance of an OP code for each month you could use sumifs.
eg:

=SUMIFS(Amount_Range,Date_Range,I5,Account_Range,"OP"&I7)
 
Upvote 0
Hi Can you guide me thru the dynamic range just in case i have to use it one day
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,738
Members
452,940
Latest member
Lawrenceiow

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