Excel Cell Manipulation

jonnyg

New Member
Joined
Dec 20, 2008
Messages
7
I am looking to be able to have more than one number in a cell and create a range for a formula to identify that cell.

Example: Cell "B2" will have the numbers 12 and 13 so that when formula is directed to identify the number 12 it will identify that cell.

I may even have more than two numbers like 12 to 14 but I can't seem to get a formula to identify that cell when more than one number is in it????

Can this be done?

Thank you mightly Excell Wizards!!:confused::mad::confused:
 
Just curious, would my problem work in Windows Vista?
No difference on Vista.


... what is this VBA solution?
Well, for me at least, it isn't a two-minute-and-here's-the-answer situation. Especially since the task is not a straight lookup - you have certain conditions (that I haven't really got my head around at this stage) on the lookup. At this stage I have been concentrating on explaining that lookups don't work the way you wanted them to.

Here is one other possible formula approach that you might see if it can be adapted to your situation. Again just looking at the VLOOKUP problem though.

I have used 2 'Helper' columns (GF:GG) to turn the original lists upside down and also just extract the lowest value from each 'range' in the left hand column. The formula in H2 then uses these columns to do the (sorted ascending) VLOOKUP.

GF3 & GG3 formulas copied down.

Excel Workbook
GHIJKLGAGBGCGDGEGFGG
1Col J valueCol GT resultCol J Inverted & lowestCol GB Inverted
23129number extracted
338-41352527
437342928
536333029
635323330
734313431
833303532
930-32293633
1029283734
1125-28273835
12
VLOOKUP (1)
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Okay, you are the best. The last option worked out great for my needs. I am able to write the data in reverse order. The blank cells do need to be in there but I just spaced the data including those blank cells. The only small problem that I am having is that I understand your formula and I only needed one formula as far as I know to do this but I am having problems with adding to the formula to cover the various columns I need.

=IF(AND($B$1>=4,$B$1<=4.03),(INDEX($GB$3:$GB$37,MATCH(C3,$J$3:$J$37,1),(IF(AND($B$1>=4.04,$B$1<=4.07),(INDEX($GB$3:$GB$37,MATCH(C3,$P$3:$P$37,1))))))))

This is the example of the formula that I wrote but I am getting a "False" response when I enter data for lets say B1 equalling 4.05 but it works for for b1 equal to 4 to 4.03. What am I missing?

Thank you again, I am so excited to complete this project!!!
 
Upvote 0
Okay, you are the best. The last option worked out great for my needs. I am able to write the data in reverse order. The blank cells do need to be in there but I just spaced the data including those blank cells. The only small problem that I am having is that I understand your formula and I only needed one formula as far as I know to do this but I am having problems with adding to the formula to cover the various columns I need.

=IF(AND($B$1>=4,$B$1<=4.03),(INDEX($GB$3:$GB$37,MATCH(C3,$J$3:$J$37,1),(IF(AND($B$1>=4.04,$B$1<=4.07),(INDEX($GB$3:$GB$37,MATCH(C3,$P$3:$P$37,1))))))))

This is the example of the formula that I wrote but I am getting a "False" response when I enter data for lets say B1 equalling 4.05 but it works for for b1 equal to 4 to 4.03. What am I missing?

Thank you again, I am so excited to complete this project!!!
I can see two basic things wrong with your formula:

1. You have two too many ')' at the end of your formula and two too few in the middle. Remove two from the end and place where I have the red ones and try that.
=IF(AND($B$1>=4,$B$1<=4.03),(INDEX($GB$3:$GB$37,MATCH(C3,$J$3:$J$37,1))),(IF(AND($B$1>=4.04,$B$1<=4.07),(INDEX($GB$3:$GB$37,MATCH(C3,$P$3:$P$37,1))))))

2. Your second IF has no 'False' argument. In other words, if ...
IF(AND($B$1>=4,$B$1<=4.03) and IF(AND($B$1>=4.04,$B$1<=4.07) are both false, your formula does not say what to do.

Now, there may be other things wrong and/or there may be another way to write the formula, but without seeing some sample data it is hard to know.

If you do have further problems, see if you can construct a smaller data set to demonstrate the problem and post your data and explain the problem in relation to that data. I suspect you found it easier to understand what I was getting at in my previous post because you could see what layout I had, what my data was and what my results were. The same applies to me.
 
Last edited:
Upvote 0
Well, it looks like you did it again. The parenthesis were added automatically for me but I guess they were wrong. I followed your formula and it works. I will have to finish some more data entry to ensure that I can keep going with the formula. Thank you again.
 
Upvote 0
The parenthesis were added automatically for me but I guess they were wrong.
When you make a mistake with a formula, Excel often makes a corrective suggestion but it also often wrong. I virtually always answer 'No' to the suggestion then 'OK' to the next message. That way it forces me to go back to my formula and work out what is wrong with it.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,369
Members
449,080
Latest member
Armadillos

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