Nested IF functions to search for/report values in new cell

bocceoverrun

New Member
Joined
Feb 19, 2015
Messages
2
I have cells that contain a citation which includes a date (e.g., 2013, 2014, or 2015). I'd like to search the cell and have the formula report which year is present in the cell. This is the formula I was trying to use, but it doesn't seem to be working:

=IF(SEARCH("2013", C2) "2013", IF(SEARCH("2014", C2), "2014", IF(SEARCH("2015", C2), "2015")))

Thank you!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
can you not just return the cell value

example in A10 if A1 = year put
Code:
=A1

why search for something that the answer is already in the cell being searched
 
Upvote 0
I have cells that contain a citation which includes a date (e.g., 2013, 2014, or 2015). I'd like to search the cell and have the formula report which year is present in the cell. This is the formula I was trying to use, but it doesn't seem to be working:

=IF(SEARCH("2013", C2) "2013", IF(SEARCH("2014", C2), "2014", IF(SEARCH("2015", C2), "2015")))

Thank you!

Can you provide an example of what a citation with a date looks like?
 
Upvote 0
Maybe:

=IF(ISNUMBER(SEARCH(2013,C2)),2013,IF(ISNUMBER(SEARCH(2014,C2)),2014,IF(ISNUMBER(SEARCH(2015,C2)),2015,"")))

Of course, this will cause a false positive if the word count happens to match a year (i.e. 2013, 2014, etc).
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,205
Members
448,554
Latest member
Gleisner2

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