Return value based on other cells

angeloudaki

New Member
Joined
Jul 7, 2015
Messages
46
Hi! I thought I had this - turns out I am rubbish.

I basically want to return a value in N3, if F3 (text data input) contains a value in N2 (header), otherwise return 0

I currently have : =COUNTIF($F3,"*"&N$2&"*") which works great to return a numerical value, but i want to later get a string of letters summarising the content instead of numbers...

e.g.:
FGHIJKLMNOPQ
2​
Accessories issuedDueprovision viaStatusNoteBag?issueIDApplePearBananaGrape
3​
Apple, Pear, BananaTBCTBCPENDINGA01APB0
4​
Apple, BananaTBCTBCPENDINGC05A0B0
5​
Grape, BananaTBCTBCPENDINGD2500BG


Obviously my diet isn't this healthy. Can't remember the last time I had an apple haha...
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Maybe
Excel Formula:
=IF(COUNTIF($F3,"*"&N$2&"*"),LEFT(N$2),0)
 
Upvote 0
Does 'Left' indicate the leftmost character?
Yes it does. :)
That formula works for me
+Fluff 1.xlsm
FGHIJKLMNOPQ
1
2Accessories issuedDueprovision viaStatusNoteBag?issueIDApplePearBananaGrape
3Apple, Pear, BananaTBCTBCPENDINGA01APB0
4Apple, BananaTBCTBCPENDINGC05A0B0
5Grape, BananaTBCTBCPENDINGD2500BG
Data
Cell Formulas
RangeFormula
N3:Q5N3=IF(COUNTIF($F3,"*"&N$2&"*"),LEFT(N$2),0)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
Sorry - another question (based upon the result) - how do I change that bit ....,LEFT(N$2),0) ..... to include the first two letters of a cell? Or do I just need to add the letters in " "?
 
Upvote 0
How about
Excel Formula:
=IF(COUNTIF($F3,"*"&N$2&"*"),LEFT(N$2,2),0)
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

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