# If Functions

#### watson86

##### New Member
I am trying to create a series of IF functions so that the cell will register a number based on the value of the previous cell. Basically something like this:
If S6>=30, then S7 should read 25
If S6 is between 31-59, then S7 should read 20
If S6 is between 60-75, then S7 should read 15
If S6 is between 76-89, then S7 should read 10
If S6 is between 90-100, then S7 should read 3

I have tried nesting the cells and using a variety of symbols, but still nothing is working it will give me the "25" value but nothing else.

I would greatly appreciate some help!

### Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

#### FDibbins

##### Well-known Member
Welcome to the forum

I would do this with a small table, and use VLOOKUP...
 A​ B​ C​ D​ 2​ 30​ 25​ 70​ 20​ 3​ 59​ 20​ 4​ 75​ 15​ 5​ 89​ 10​ 6​ 100​ 3​
D2=VLOOKUP(C2,\$A\$2:\$B\$6,2,1)

#### Guru008

##### Board Regular
Hi,

There is logical error in your formulae

S6>=30, then S7 should read 25 should be "S6<=30, then S7 should read 25" because if we use >= for value 25 then every next condition will be fulfil as all the condition have value greater than 30, thats why your formula is giving 25 everytime

#### Dathoang16

##### New Member
Hi
I think this formula may work

= lookup(S6,{30,31,60,76,90},{25,20,15,10,3})

#### BarryL

##### Well-known Member
Hi
I think this formula may work

= lookup(S6,{30,31,60,76,90},{25,20,15,10,3})

I'm not sure but I think maybe the OP wants 25 for everything up to and including 30. If that's the case I'll amend your formula slightly

=LOOKUP(S6,{0,31,60,76,90},{25,20,15,10,3})

#### watson86

##### New Member
I'm not sure but I think maybe the OP wants 25 for everything up to and including 30. If that's the case I'll amend your formula slightly

=LOOKUP(S6,{0,31,60,76,90},{25,20,15,10,3})

I pasted this in the cell and it didn't work. Thank you.

#### Dathoang16

##### New Member
Does it show #N/A in the cell?

You can try this formula work

=LOOKUP(Value(S6),{0,31,60,76,90},{25,20,15,10,3})

Last edited:

#### watson86

##### New Member
So far, none have worked. They all return the first value of 25, but nothing else when the value in S6 changes.

#### FDibbins

##### Well-known Member
Did you try my suggestion in post #2?

#### watson86

##### New Member
Did you try my suggestion in post #2?

I-don't-know-how-to-do-that-(thepostwontletmespace

Replies
2
Views
569
Replies
6
Views
434
Replies
4
Views
756
Replies
3
Views
499
Replies
4
Views
956

Threads
1,191,215
Messages
5,985,314
Members
439,956
Latest member
venky2002

### 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

### 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