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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
The solution in post #3 should work with some adjustment. If you need a vlookup, just substitute it for B2, C2, etc in the formula. You could also use an advanced filter, remove duplicates, or the pivot table to get a unique list of the source data. What have I overlooked?
 
Upvote 0
when i took the solution in post#3 and change the names like COGS & S&M & G&A, it didn't give me with the correct answer and it shows result of line 4 in line 5 also !!

The solution in post #3 should work with some adjustment. If you need a vlookup, just substitute it for B2, C2, etc in the formula. You could also use an advanced filter, remove duplicates, or the pivot table to get a unique list of the source data. What have I overlooked?
 
Upvote 0
could you please my example in post#8, I showed an example of what I got and what I want to reach
your support is highly appreciated
 
Upvote 0
Serial No# Account No. Activity Cost Center
Sub Category
1 51110101 211 211 Cost of Sales
2 51110101 212 212 Cost of Sales
3 53110101 111 383 G&A
4 53110101 231 400 G&A
5 53110101 231 341 Sales & Marketing
6 51110101 111 312 Sales & Marketing


Is the source (sheet we're looking up from)?

The account #s appear multiple times with different activity and cost center numbers. How do you know which to choose? Or does each get a new subcategory (i.e. 1,2,etc)?
 
Upvote 0
that's what I'm talking about because cost center ( 312 & 341 ) have different treatment under Activity (231 & 111) that's why line 4 different than line 5

so the whole sheet have only 2 criteria ( account number & Activity number )
but the lines which have cost center (312 & 341 ) have extra criteria ( account number + Activity + Cost Center )

Serial No# Account No. Activity Cost Center
Sub Category
1 51110101 211 211 Cost of Sales
2 51110101 212 212 Cost of Sales
3 53110101 111 383 G&A
4 53110101 231 400 G&A
5 53110101 231 341 Sales & Marketing
6 51110101 111 312 Sales & Marketing


Is the source (sheet we're looking up from)?

The account #s appear multiple times with different activity and cost center numbers. How do you know which to choose? Or does each get a new subcategory (i.e. 1,2,etc)?
 
Upvote 0
that's why i gave an example in the beginning of the post

1) if account number XXXX have Activity (211 or 212 ) = it's subcategory will be (xxxx)
2) if the same account number have activity (111 or 231 ) = it subcategory will be (YYYY)
3)if the same account number have activity (111 or 231) and have cost center (312 or 341 ) = it's subcategory will be (zzzz)

Serial No# Account No. Activity Cost Center
Sub Category
1 51110101 211 211 Cost of Sales
2 51110101 212 212 Cost of Sales
3 53110101 111 383 G&A
4 53110101 231 400 G&A
5 53110101 231 341 Sales & Marketing
6 51110101 111 312 Sales & Marketing


Is the source (sheet we're looking up from)?

The account #s appear multiple times with different activity and cost center numbers. How do you know which to choose? Or does each get a new subcategory (i.e. 1,2,etc)?
 
Upvote 0
So what goes in the last 2 columns?


Excel 2010
ABCDE
1Account NumberActivityCost CenterSUb Category 1Sub Category 2
252310101211211
353130150212325
453140101111400
553140103231410
653140109231312
753150150111341
Sheet16
 
Last edited:
Upvote 0
our mapping show all Activity ( 111 & 231 ) shall be classified as G&A except combination which cost centers are ( 312 & 341 ) shall be classified as S&M

So what goes in the last 2 columns?

Excel 2010
ABCDE
1Account NumberActivityCost CenterSUb Category 1Sub Category 2
252310101211211
353130150212325
453140101111400G&A XXX
553140103231410G&A XXX
653140109231312S&M XXX
753150150111341S&M XXX

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet16
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,077
Members
449,094
Latest member
mystic19

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