Would an IF statement or LOOKUP be better for this?

Candide

New Member
Joined
Feb 5, 2017
Messages
7
Office Version
  1. 2021
Hi all,

Trying to figure out how to flag whether data from Sheet1 B1 can be flagged in C1 whether it is a true statement from Sheet2. For example I have a table with customer's favorite number in Sheet1 and I am trying to flag in the C1 cell if it is a Fibonacci, prime and/or square number.

Can anyone help me? When I have used LOOKUP and IF statements it comes up with #SPILL!
Sheet 1 - table
1699096416823.png

Sheet 2 - not in a table. Should it be in a table?
1699096511456.png
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
In cell C2 put:
Excel Formula:
=SUM(--(B2=Sheet2!$a$2:$c$400))>0

you may need to enter with CNTL-SHFT-ENTR (since you don't say what version of excel you use - please update your profile).
 
Upvote 1
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Maybe
Excel Formula:
=TEXTJOIN(", ",,IF(Sheet2!$A$2:$C$100=B2,Sheet2!$A$1:$C$1,""))
 
Upvote 1
Solution
I've updated my account to reflect 2021 Excel.

Thank you both so much for your help. Both formulas work well and I am slightly modifying them to suit my needs. Thank you both again!!!!!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,092
Messages
6,123,063
Members
449,090
Latest member
fragment

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