Lookup number of values within a range

sanwar1

New Member
Joined
Aug 31, 2012
Messages
26
Hello all, I have a task that I need help with. Let's say on one cell I have the value of "267.0-268.3". And I have a master list that might be like something below:

267.0
267.1
267.3
267.8
268.9

I need a formula that will look at "267.0-268.3" and return the number of codes on master list that fall between those two numbers. So in this particular example, it will return the value of "4".

Any help is appreciated.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
With codes in A1:A5, and cell A9 containing 267.0-268.3, use:
Code:
=SUMPRODUCT(--(A1:A5>=--LEFT(A9,FIND("-",A9)-1)),--(A1:A5<=--RIGHT(A9,LEN(A9)-FIND("-",A9))))
 
Upvote 0
Hello Ron,

Thank you for the response. I tried this, but it doesn't seem to work. It's returning a value of 0.
 
Upvote 0
It works on my spreadsheet. Would you post the data the way it's set-up in your worksheet. Do you have the data in cells A1 thru A5. Exactly how is the 267.0-268.3 entered in A9?
 
Upvote 0
Okay, I think my issue is the formatting of data in my original table. I'll clean that up and try again. I just did what you suggested in a new sheet and it worked fine. Thank you so much for the help. That was exactly what I was looking for.
 
Upvote 0

Forum statistics

Threads
1,214,822
Messages
6,121,770
Members
449,049
Latest member
greyangel23

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