Filter function to use cell values instead of formula

Newbie73

Board Regular
Joined
Feb 4, 2024
Messages
109
Office Version
  1. 365
Platform
  1. Windows
Hello, I'm trying to create a search box in a spreadsheet with hundreds and sometimes thousands of data:

Excel Formula:
=FILTER(B12:N2004,B12:B2004=C2)

This is what I'm using now and it works perfect IF I convert all the values of B to numbers (Values of the column B are obtained through a formula which provides then 4 digits, 1234 for example).

Is there any way to add to the Filter formula to use the numbers in the cell? I have dozens of spreadsheets that need to be updated from time to time, that's why I'm trying to avoid the converting to number option.

Can provide a small spreadsheet example if necessary and sorry if it's a stupid question.

Thanks!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
can you *1
=FILTER((B12:N2004)*1,(B12:B2004)*!=C2)

or maybe
=FILTER(--(B12:B2004),--(B12:B2004)=C2)

to change the text numbers to real numbers

an example would be good to see
 
Upvote 0
Hello, you're right so I've done a mini version of it:

test1.xlsx

Do let me know if that helps, first formula gives a error and doesn't let me use it and the second formula gives a #Value error.

Let me know if I can do anything else to help!
 
Upvote 0
not following with the example posted
where is the filter function?

where is the problem
the text function will show text numbers to change to real numbers

=IF(B5<>0, RIGHT(TEXT(B5,"0000"),4)*1, "")

OR

i have added a filter

=FILTER(A5:D10,(A5:A10)*1=L2)

is that what you mean

test1.xlsx
ABCDEFGHIJKLMN
1SearchExample done manually
2abcdSearch5780
3abcd
4abcd5780PPP74556130578043
52594PPP74656060259459
65780PPP74556130578043
74761PPP745561604761585780PPP74556130578043
82817PPP74556110281731
96046PPP74556130604653
102566PPP74656060256653
11
12
Sheet1
Cell Formulas
RangeFormula
K7:N7K7=FILTER(A5:D10,(A5:A10)*1=L2)
A5:A10A5=IF(B5<>0, RIGHT(TEXT(B5,"0000"),4), "")
Dynamic array formulas.
 
Upvote 0
Solution
The filter function is now in the example sheet sorry about it. The problem was with the formula in the Column it would give a #Value error but with your change to the other formula it now works! I do apologise if it was a stupid question but that change you did, did the trick :)

Excel Formula:
=IF(B5<>0, RIGHT(TEXT(B5,"0000"),4)*1, "")
 
Upvote 0
(y) (y) you are welcome

various ways to do that also
=IF(B5<>0, --RIGHT(TEXT(B5,"0000"),4), "")
=IF(B5<>0, RIGHT(TEXT(B5,"0000"),4)+0, "")
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,206
Members
452,618
Latest member
Tam84

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