using cell value in a formula

smakatura

Board Regular
Joined
May 27, 2011
Messages
141
  • A2 contains a forumula that returns a value of 12345.
    • of course when you select on A2 it shows the forumula that creates that value.
  • in b2 I want to add a formula that
    • looks at the final value of A2 (12345)
    • looks for it on a list of values in column c
    • if result is N/A (bc value is not on C) - says NO
    • if result is not N/A (bc value is on C) - says Yes
my initial thoughts are:
HTML:
=if(isna(lookup(value(b2),c:c))=true, "NO", "YES"

so if the value of the cell is in column C, it puts yes, if not in the column puts No.

for some reason it is not working. I think it has to do with using the value function inside the isna/lookup function.

any suggestions
 
Last edited:

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
  • A2 contains a forumula that returns a value of 12345.
    • of course when you select on A2 it shows the forumula that creates that value.
  • in b2 I want to add a formula that
    • looks at the final value of A2 (12345)
    • looks for it on a list of values in column c
    • if result is N/A (bc value is not on C) - says NO
    • if result is not N/A (bc value is on C) - says Yes
my initial thoughts are:
HTML:
=if(isna(lookup(value(b2),c:c))=true, "NO", "YES"

so if the value of the cell is in column C, it puts yes, if not in the column puts No.

for some reason it is not working. I think it has to do with using the value function inside the isna/lookup function.

any suggestions
Try...

=IF(ISNUMBER(MATCH(A2,C:C,0)),"Yes","No")

With VLOOKUP, it would be:

=IF(ISNA(VLOOKUP(A2,C:C,1,0)),"No","Yes")
 
Upvote 0
Turns out my original formula did work (I figured it out after I posted the original post). but I love that "isnumber" function, i had not used that before

that worked great

thanks
 
Upvote 0
Turns out my original formula did work (I figured it out after I posted the original post).

LOOKUP would require that C:C is in ascending order. If CC is indeed in ascending order, assuming exact match, try rather:

=IF(ISNUMBER(1/(LOOKUP(B2,C:C)=B2),"Yes","No")

but I love that "isnumber" function, i had not used that before

that worked great

thanks

You are welcome. Thanks for providing feedback.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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