Help with IF formula

WillM66

New Member
Joined
Jul 15, 2010
Messages
10
Hello,

My partner has asked me to help with a spreadsheet she uses in her role as a Teaching Assistant. The spreadsheet is used to calculate 'points' for good work/behaviour which are then converted to a cash value (which can be redeemed for various awards/prizes).

The formula they are using is as follows:

=(IF(AND(D51>=0,D51<=25),0,IF(AND(D51>=26,D51<=30),1,IF(AND(D51>=31,D51<=34),3,IF(AND(D51>=35,D51<=100),5,"")))))+E51+F51+G51

D51 is the total points awarded for a student in that week.

What they have, however, is 2 groups of students where the parameters are different. These are 'TEC1' and 'TEC2' (these are listed in Column C in the spreadsheet). They will be awarded £1 if they get between 30-35 points and £3 if they get between 35-39 points.

Essentailly she needs a formala which says IF its TEC1 or TEC2 the rules are x , if not the rules are y.

Thanks in advance.

Will M
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
What are the rules for TEC1 & TEC2?
 
Upvote 0
Hi, but this formula

The formula they are using is as follows:

=(IF(AND(D51>=0,D51<=25),0,IF(AND(D51>=26,D51<=30),1,IF(AND(D51>=31,D51<=34),3,IF(AND(D51>=35,D51<=100),5,"")))))+E51+F51+G51

They will be awarded £1 if they get between 30-35 points and £3 if they get between 35-39 points.

Will M

does not include this range
They will be awarded £1 if they get between 30-35 points and £3 if they get between 35-39 points.
 
Upvote 0

Well, following your example...
In addition, you should check the condition 30-35 points and £3 if they get between 35-39 points, because point 35 must be part of a single comparison vector

Book1
ABCDEFGHIJKLMNOPQ
1
2
3TypeWeek pointsSuggestion
4TEC1395
5TEC2393
6
7LEVELTEC1MoneyLEVELTEC2Money
810-25010-290
9226-301230-341
10331-343335-393
11435-1005440-1005
12
Sheet14
Cell Formulas
RangeFormula
H4:H5H4=IF(C4="TEC1",IF(AND(D4>=0,D4<=25),0,IF(AND(D4>=26,D4<=30),1,IF(AND(D4>=31,D4<=34),3,IF(AND(D4>=35,D4<=100),5,""))))+E4+F4+G4,IF(AND(D4>=0,D4<=29),0,IF(AND(D4>=30,D4<=34),1,IF(AND(D4>=35,D4<=39),3,IF(AND(D4>=40,D4<=100),5,""))))+E4+F4+G4)
Cells with Data Validation
CellAllowCriteria
C4:C5ListTEC1,TEC2
 
Upvote 0
Another option
=IF(C51="Tec1",LOOKUP(D51,{0,26,31,35},{0,1,3,5}),IF(C51="Tec2",LOOKUP(C51,{0,30,36,40},{0,1,3,5}),""))+SUM(E51:G51)
 
Upvote 0
Hello,

I was probably unclear in my original post.

The majority of classes have the following parameters:

Between 26 and 31 points = £1
Between 31 and 35 points = £3

These classes have a variety of names and are all found in Column C.

Only classes TEC1 and TEC2 have different parameters as follows:

Between 30 and 35 points = £1
Between 35 and 39 points = £3

I want the formula to say, if it's TEC 1 or TEC 2 award x points, if it's anything other than TEC1 or TEC2 award y points.

Hope this makes more sense.

Will M
 
Upvote 0
Ok, how about
=IF(OR(C51={"Tec1","Tec2"}),LOOKUP(D51,{0,30,36,40},{0,1,3,5}),LOOKUP(D51,{0,26,31,35},{0,1,3,5}))+SUM(E51:G51)
 
Upvote 0
Hi.
...
The majority of classes have the following parameters:

Between 26 and 31 points = £1
Between 31 and 35 points = £3

Tell me, if someone gets 31 points, how many pounds would earn? £1 or £3?

Well, same for this case
...
Only classes TEC1 and TEC2 have different parameters as follows:

Between 30 and 35 points = £1
Between 35 and 39 points = £3
...

Tell me, if someone gets 35 points, how many pounds would earn? £1 or £3?

For better experience, If you want...
Please try prepare a data example using add-in specifically for this and it can be found here XL2BB
Pay attention to this post XL2BB 2 Squares
 
Upvote 0
Update:

Hello,

i ended up doing a two stage approach using an IFS formula, the output of which is then used in a VLOOKUP.

All is working swimmingly, but we have hit a problem with ecel versions. Looks like the IFS doens't work on an early version of excel that they're using in the school. So what I need to do is convert this formula:

=IFS(B3="TEC1",3,B3="TEC2",3,B3<>"tec1",2,B3<>"tec2",2)

To work just using IF. I've tried following some guidance on nested/multiple IF formula, but I'm getting nowhere - any helpo ?

thanks,

Will M

 
Upvote 0
Maybe
=--LEFT(IF(B3="TEC1",3,"") & IF(B3="TEC2",3,"")&IF(B3<>"TEC1",2,"")& IF(B3<>"TEC2",2,""),1)

But I insist, that you should check your conditions
 
Upvote 0

Forum statistics

Threads
1,215,417
Messages
6,124,787
Members
449,188
Latest member
Hoffk036

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