Reference min and max to determine which segment

thp510

Board Regular
Joined
Oct 19, 2015
Messages
110
Office Version
  1. 365
Platform
  1. Windows
Hello. I have a lot of rows of data that indicate a company's employee size from 1 - 100k. We are doing an exercise to determine which segment each of these companies fall under based on their employee size. If it's 1-1000, it's SMB. If it's 1001-5000 it's Commercial. If it's over 5k than it's Enterprise. Rather than doing a nested IF statement on a column that looks at the employee count and then copying the formula all the way down the rows, is there an easier way to do this by just referencing a table on another worksheet? For example, I have created a table like this on a separate worksheet (or off to the side in another column):
ABC
1MinMaxSegment
211000SMB
310015000Commercial
45001No MaxEnterprise

I'm hoping to just reference this table instead to determine what segment the account should be in. This way if I need to change the min and max thresholds for each segment, I don't have to change the formula all the way down the rows and I can just change this table above. Hope that makes sense.

Thanks!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Setting up a VLOOKUP with an Approximate return like this will give you what you need.

test varieties.xlsm
BCD
1MaxSegment
21SMB
31,000SMB
41001Commercial
55,000Commercial
65,001Enterprise
7999,999,999Enterprise
8
9500SMB
101200Commercial
1110450Enterprise
Sheet12
Cell Formulas
RangeFormula
C9:C11C9=VLOOKUP(B9,$C$2:$D$7,2,TRUE)
 
Upvote 0
Hi THP510,

I see you have an answer using VLOOKUP, so I'll take the same approach using INDEX and MATCH

THP510-2.xlsx
ABCDEF
1MinSegmentEmployeesSegment
21SMB1SMB
31001Commercial5SMB
45001Enterprise1000SMB
51001Commercial
62000Commercial
75000Commercial
85001Enterprise
99999999Enterprise
Sheet1
Cell Formulas
RangeFormula
F2:F9F2=INDEX($B$2:$B$4,MATCH(E2,$A$2:$A$4,1))
 
Upvote 0

Forum statistics

Threads
1,215,016
Messages
6,122,700
Members
449,092
Latest member
snoom82

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