Assign value based on table

concenhr23

New Member
Joined
Apr 24, 2020
Messages
8
Office Version
  1. 2010
Platform
  1. Windows
Hi,
Hoping someone can help me formulate this. I have a list of products in Column A, e.g. Product number Z3415R has a total of 13. I need to assign a specific amount of products to each of the states I have listed. Right now, I have to assign the state in Column B based on the table I have on the left. So for Product Z3415R, NJ will get three, NY gets two and IL gets 4...etc. For each product number, I have to do the same. I tried IF and COUNTIF <= but I can get to work. Thanks in advance!
State
Column AColumn BProductNJNYILORTXTotal
Product ListStateZ3415R3241313
Z3415RNJG2891Q4352418
Z3415RNJA7768Y122319
Z3415RNJ
Z3415RNY
Z3415RNY
Z3415RIL
Z3415RIL
Z3415RIL
Z3415RIL
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Should be a simple COUNTIFS formula (COUNTIFS was introduced with Excel 2010).

If the data in your table is in the range A1:B12 and your first entry in you count table (for "Z3145R/NJ") is in cell F3, enter this formula in cell F3 and copy to the rest of those cells:
Excel Formula:
=COUNTIFS($A$4:$A$12,$E3,$B$4:$B$12,F$2)
 
Upvote 0
Should be a simple COUNTIFS formula (COUNTIFS was introduced with Excel 2010).

If the data in your table is in the range A1:B12 and your first entry in you count table (for "Z3145R/NJ") is in cell F3, enter this formula in cell F3 and copy to the rest of those cells:
Excel Formula:
=COUNTIFS($A$4:$A$12,$E3,$B$4:$B$12,F$2)
Sorry, it's hard to explain. My apologies for the confusion. The table is previously summarized, then I review the list and assign them manually in column D. The product list doesn't have any data in that column to start. I would like to populate Column B based on the table. Hopefully, this makes sense
 
Upvote 0
Sorry, it's hard to explain. My apologies for the confusion. The table is previously summarized, then I review the list and assign them manually in column D. The product list doesn't have any data in that column to start. I would like to populate Column B based on the table. Hopefully, this makes sense
So, are you saying that you are starting off with the table that you have on the right side, and columns A and B are initially blank, and you are trying to build that list in columns A and B form your table?

I think I could figure out a way to do that using VBA, but I do not know of a formulaic approach (without VBA). Not saying that one doesn't exist, it is just beyond my capabilities.
 
Upvote 0
So, are you saying that you are starting off with the table that you have on the right side, and columns A and B are initially blank, and you are trying to build that list in columns A and B form your table?

I think I could figure out a way to do that using VBA, but I do not know of a formulaic approach (without VBA). Not saying that one doesn't exist, it is just beyond my capabilities.
Column B is blank. The table is a reference on how many products are flagged as the State Code. In other words, NJ gets three product code Z3145R and NY gets two product code Z3145R
 
Upvote 0

Forum statistics

Threads
1,215,132
Messages
6,123,227
Members
449,091
Latest member
jeremy_bp001

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