Creating IF function to check between a range of values

clancymv

New Member
Joined
Feb 17, 2016
Messages
5
I'm trying to create an IF function where the logical test involves a search between a range of values.

I'm want to have a cell that searches a defined set of cells (e.g. C4:C100) for numbers that fall between two values, if it finds a number that falls between those two values, then it will pull up a value from another cell (name of a compound), and if it doesn't, then leave the cell blank.

I want to search all the retention times of peaks from a chromatogram, where each peak corresponds to a compound. If the function finds a peak that's at 5min from the list, and I've set it to look between 4.5-5.5mins, it will give me the name and area (from two different cells), and if it doesn't find a value between those two times it just stays blank.

What I'm trying so far (with examples for cell numbers): =IF(AND((H14:H350)>A6;(H14:H350)<b6);and(d6;g6);"")

I don't even know if it's possible to have the IF function search between groups of numbers like that.

Thanks in advance for any help!</b6);and(d6;g6);"")
 
I just realised I left out a few brackets in my examples, in the actual function they're all fine! The function *technically* works, but it just gives me a zero.
 
Upvote 0
In my example boundaries are set in cell A1 and B1 (e.g 4.5 and 5.5)

Column A3:A8 = your values that you want to test against the boundaries in A1 and B1

Column B3:B8 = Name

Column C3:C8 = Area

Column D = =IF(IF(AND($A$3:$A$8>$A$1,$A$3:$A$8<$B$1),$B$3:$B$8,"")="","",CONCATENATE("Name: ",IF(AND($A$3:$A$8>$A$1,$A$3:$A$8<$B$1),$B$3:$B$8,"")," / Area: ",IF(AND($A$3:$A$8>$A$1,$A$3:$A$8<$B$1),$C$3:$C$8,"")))

Pic of my file: Image - TinyPic - Free Image Hosting, Photo Sharing & Video Hosting
 
Upvote 0

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