# Assigning a value to cell based on the differing values of two other cells

#### Schopenhauer

##### New Member
Hello, everyone! I'm a newly-registered Excel afficianado and have a head-scratcher that I'm having a hard time figuring out.

Here's the problem: I have two cells that contain two numeric values paired together. These values are all in one, sequential column. I need some kind of formula that will generate a third value based on those two cells. I'll give you an example:

Cell 1 : 4.55
Cell 2: 8.99

Cell 3: 9.00
Cell 4: 11.23

Cell 5: 11.24
Cell 6: 17.56

Cell 1 & 2 are the first pair, Cell 3 & 4 are the second, etc.

So, if I enter the number 10.22, the resulting value is "X." If I enter 5.01, the resulting value is "Y." This value is generated in another column.

I hope that's clear. Thank you!

Last edited:

### Excel Facts

Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
I don't understand the relationship here.

I don't understand the relationship here.

Yeah, sorry... I know it's a bit confusing.

So essentially I want to look up a value that falls between two other values.

Here's what I have so far, but it's not pulling the correct value:

=IF ((COUNTIF(\$B\$2:\$B\$3>1.1364) - COUNTIF(\$B\$2:\$B\$3<1.1628)), 12)

So if I have a value of 1.1400, the formula figures out that my entry falls in between the values of 1.1364 and 1.1628, and the value 12 is placed in my formula cell.

Does that make it clearer?

Replies
1
Views
88
Replies
8
Views
296
Replies
1
Views
213
Replies
1
Views
173
Replies
2
Views
165

1,207,097
Messages
6,076,556
Members
446,213
Latest member
bettigb

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

### Which adblocker are you using?

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

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