IF AND/OR formula issues

Ketterj

New Member
Joined
Apr 26, 2017
Messages
2
Team,
First - thank you for taking a look at this. Secondly, I am struggling to get Excel to return the correct values for the given data set below that corresponds to the two tables. I have 2 tables (PEG and SEG) that have a tier with an associated range for each. I am trying to take the Category column and the Value column to return the correct Tier (Expected Result column) based upon their combination. I prepopulated the Expected Result column based upon what the result should be. If have tried using an IF function combined with AND as well as OR and none of the multitude of formulas I have tried are returning the correct results. I am sure that I am missing something simple, but am in need of assistance with this. Any help would be tremendously appreciated. Thank you.
 

Attachments

  • Excel issue.jpg
    Excel issue.jpg
    67.5 KB · Views: 9

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Try this in C2 and fill down
Excel Formula:
=IF(B2="PEG",LOOKUP(A2,$F$4:$F$7,$E$4:$E$7),IF(B2="SEG",LOOKUP(A2,$F$14:$F$17,$E$14:$E$17),B2))

edit:- thanks for the mini-sheet @Toadstool, I don't have the patience to retype screen caps.
Book1
ABCDEFG
1ValueCategoryResult
2150PEGP1Peg
3174PEGP1TierBottom RangeTop Range
494SEGS1P10250
5590SEGS3P22501000
673PPSPPSP3100099999
725PPPPPPP4
8127SEGS2PPP
9312PEGP2TRM
10833PPSPPS
1110TRMTRM
12575TRMTRMSeg
13276SEGS2TierBottom RangeTop Range
14705SEGS3S10100
15259SEGS2S2100500
1650PEGP1S350099999
17452SEGS2S4
18317PEGP2PPS
Sheet7
Cell Formulas
RangeFormula
C2:C18C2=IF(B2="PEG",LOOKUP(A2,$F$4:$F$7,$E$4:$E$7),IF(B2="SEG",LOOKUP(A2,$F$14:$F$17,$E$14:$E$17),B2))
 
Upvote 0
Hi Ketterj,

If the range has a bottom limit then I've added a top limit (otherwise it gets more complicated) but this should do what you ask.

Ketterj.xlsx
ABCDEFG
1ValueCategoryResult
2150PEGP1Peg
3174PEGP1TierBottom RangeTop Range
494SEGS1P10250
5590SEGS3P22501000
673PPSPPSP3100099999
725PPPPPPP4
8127SEGS2PPP
9312PEGP2TRM
10833PPSPPS
1110TRMTRM
12575TRMTRMSeg
13276SEGS2TierBottom RangeTop Range
14705SEGS3S10100
15259SEGS2S2100500
1650PEGP1S350099999
17452SEGS2S4
18317PEGP2PPS
Sheet1
Cell Formulas
RangeFormula
C2:C18C2=IF(A2="","",IF(ISNUMBER(MATCH(B2,$E$3:$E$18,0)),B2,IF(B2=$F$2,INDEX($E$4:$E$9,AGGREGATE(15,6,ROW($F$4:$F$9)-ROW($F$3)/(($F$4:$F$9<=A2)*($G$4:$G$9>=A2)),1)),INDEX($E$14:$E$19,AGGREGATE(15,6,ROW($F$14:$F$19)-ROW($F$13)/(($F$14:$F$19<=A2)*($G$14:$G$19>=A2)),1)))))
 
Upvote 0

Forum statistics

Threads
1,215,616
Messages
6,125,865
Members
449,266
Latest member
davinroach

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