how to merge multi If with Vlookup ?

belal

New Member
Joined
Mar 13, 2016
Messages
38
Dears,
kindly I want to fill Column sub Category 1 & 2 from another sheet with the Following Condition


Sub Category 1 will be :
if (Activity coloumn = 211 or 212) : COGS
if (Activity
[FONT=&quot]coloumn[/FONT][FONT=&quot]= 111 or 231) : G&A[/FONT]
if (Activity [FONT=&quot]coloumn[/FONT][FONT=&quot]= 111 or 231 & Cost center = 312 & 341 ) : S&M

i think i need to make multi If Function + Vlookup [/FONT]:confused::confused::confused:[FONT=&quot] [/FONT]


ِAccount NumberActivityCost CenterSUb Category 1Sub Category 2
52310101

<tbody>
</tbody>
211211

53130150

<tbody>
</tbody>
212325

53140101

<tbody>
</tbody>
111400

53140103

<tbody>
</tbody>
231410

53140109

<tbody>
</tbody>
231312

53150150

<tbody>
</tbody>
111341


<tbody>
</tbody>
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
let's think this is new sheet i'm looking to fill it, ok :)
and i want to create the function to fill subcategory 1

as i told you our mapping in the company is :
Activity : 211 or 212 will be COGS
Activity : 111 or 231 will be S&M
Activity : 111 or 231 with Cost center ( 312 or 341) will be S&M

for sure the name will not be only COGS or S&M or G&A , i just try to explain our map. so i want to creat equation to fill rows of new sheet from our Database.

For Example :
line 1 to 5: we need to make vlookup with two criteria (search with account number & Activity)
line 6 to 7: we need to make vlookup with three criteria ( account number & activity & Cost center )


MY Question now :
what's the equation give me this result?i want to make an equation for 30K row :(

So what goes in the last 2 columns?

Excel 2010
ABCDE
1Account NumberActivityCost CenterSUb Category 1Sub Category 2
252310101211211COGS XXX
353130150212325COGS YYY
453140101111400G&A ZZZ
553140103231410G&A MMM
653140109231312S&M CCC
753150150111341S&M AAA

<tbody>
</tbody>
Sheet16
 
Last edited:
Upvote 0
i make it clear now, look at below example and you will understand what i mean :D
Line 1 is unique ( we can search by account number & Activity)
Line 3 & 4: the same Account number & Activity but different Cost center, so it gives you different result
So what goes in the last 2 columns?

Excel 2010
ABCDE
1Account NumberActivityCost CenterSUb Category 1Sub Category 2
252310101212325COGS XXX
353140101111400G&A XXX
453140101111341S&M XXX

<tbody>
</tbody>
Sheet16
 
Upvote 0
53140101 isn't in this table:


Excel 2010
ABCDE
1Serial No#Account No.ActivityCost CenterSub Category
2151110101211211Cost of Sales
3251110101212212Cost of Sales
4353110101111383G&A
5453110101231400G&A
6553110101231341Sales & Marketing
7651110101111312Sales & Marketing
Sheet2 (2)


Can you post it? Don't worry about posting too much, go for like 40-50 rows if you can.

Sounds like you want a multi column lookup, very easy to do, I just have to know where to look for it.
 
Upvote 0
i don't understand !!

53140101 isn't in this table:

Excel 2010
ABCDE
1Serial No#Account No.ActivityCost CenterSub Category
2151110101211211Cost of Sales
3251110101212212Cost of Sales
4353110101111383G&A
5453110101231400G&A
6553110101231341Sales & Marketing
7651110101111312Sales & Marketing

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2 (2)



Can you post it? Don't worry about posting too much, go for like 40-50 rows if you can.

Sounds like you want a multi column lookup, very easy to do, I just have to know where to look for it.
 
Upvote 0
Post the first table with the data you're looking up. Not all 30,000 rows of course, but enough where I can see a pattern, say 30-50. Then post a results table that shows every possible condition. I'll write a formula that returns the same data, and if something's missing you can tell me and we'll adjust.
 
Upvote 0

Forum statistics

Threads
1,215,111
Messages
6,123,159
Members
449,098
Latest member
Doanvanhieu

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