Can this rule be applied in a sigle cell function?

FreeRangeJ

New Member
Joined
Feb 7, 2013
Messages
40
I have a column of GROUP (1 through 5), another column of [C] TERRITORY (1 or 2) and a column of [E] GROUP SPACE AVAILABLE and depending on the 10 possible variables of those 2 columns I have 3 potential outcomes, [E]*0 , [E]*1 or [E]*2 to go incolumn F if this rule is at all possible in a single cell expression, i.e. without a lookup table using Index/Match, I'm picturing something like a nested IF AND OR statement but can't quite picture the flow / order

Site IDRanked GroupTerritoryStock IDGroup Space Available (cm)Group Space Used (cm) Desired Result
3456OneOne1234550[=E2*2]
7890TwoOne2345650[=E3*2]
2345ThreeOne3456750{=E4*0]
5678FourOne4567850[=E5*1]
9876FiveOne5678950[=E6*1]
2345OneTwo76543100[=E7*2]
6547TwoTwo87654100[=E8*1]
8745ThreeTwo98765100[=E9*1]
3465FourTwo65432100[=E10*1]
3567FiveTwo54321100[=E11*1]

<tbody>
</tbody>
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I read it and then reread it and i dont see a rule here. What is it?
 
Upvote 0
Sorry, you're right, I've been bending my head round this all night for a job I technically finished yesterday and I guess i'm not making mush sense!

The rule is that if it is Territory 1 , then groups 1 & 2 get 2x the group allocation of space, groups 4 & 5 get a single allocation of the group space but group 3 gets none
if it is territory 2 then group 1 gets a double allocation of the group space and the other groups 2 through 5 get a single allocation

Or another way of looking at it, Group 1 gets a double allocation whether territory 1 or 2 and all other groups get a single allocation of the space, except in territoty 1 group 3 doesn't get any allocation and that gets added onto group 2's allocation

i really don't know if that makes it any clearer!
 
Upvote 0
Are those worded numbers really words? You would probably find the formulas easier if they were really numbers. Anyhow this works with what you have provided:

=E2*IF(C2="One",VLOOKUP(B2,{"one",2;"two",2;"three",0;"four",1;"five",1},2,0),IF(C2="Two",VLOOKUP(B2,{"one",2;"two",1;"three",1;"four",1;"five",1},2,0),0))
 
Upvote 0
No the worded number are just anonymised examples of the 5 variants of the Group Labels and the 2 variants of the Territory label I have, just trying to simplify my request as I've been on this since yesterday and I think i'm struggling to communicate my requirements to be honest

Just going to test your solution now, it's going into a s/sheet with aprox 600k rows that this would be popultaing against

I'll keep you posted!
 
Upvote 0
try this


Book1
ABCDEF
1Site IDRanked GroupTerritoryStock IDGroup Space Available (cm)Group Space Used (cm) Desired Result
23456111234550100
37890212345650100
423453134567500
5567841456785050
6987651567895050
723451276543100200
865472287654100100
987453298765100100
1034654265432100100
1135675254321100100
Sheet1
Cell Formulas
RangeFormula
F2=CHOOSE(C2,CHOOSE(B2,2,2,0,1,1),CHOOSE(B2,2,1,1,1,1))*E2
 
Upvote 0
Hi,

Following your description, this will produce the results you want:


Book1
ABCDEFG
1Site IDRanked GroupTerritoryStock IDGroup Space Available (cm)Group Space Used (cm) Desired ResultFormula Result
23456OneOne1234550[=E2*2]100
37890TwoOne2345650[=E3*2]100
42345ThreeOne3456750{=E4*0]0
55678FourOne4567850[=E5*1]50
69876FiveOne5678950[=E6*1]50
72345OneTwo76543100[=E7*2]200
86547TwoTwo87654100[=E8*1]100
98745ThreeTwo98765100[=E9*1]100
103465FourTwo65432100[=E10*1]100
113567FiveTwo54321100[=E11*1]100
Sheet408
Cell Formulas
RangeFormula
G2=E2*IF(AND(B2="Three",C2="One"),0,IF(AND(B2="Two",C2="Two"),1,IF(OR(B2={"One","Two"}),2,1)))


Formula copied down.
 
Upvote 0

Forum statistics

Threads
1,215,235
Messages
6,123,782
Members
449,123
Latest member
StorageQueen24

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