Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Formula help 1

Status
Not open for further replies.

bamundsen

IS-IT--Management
Dec 5, 2001
58
US
Hello:

I have a column of year ranges like this:

Year
1999-1999
1990-1997
2005-2005

I would like to convert any year ranges that are identical such as 2005-2005 to 2005. Currently I run a Find/Replace, but I have year ranges all the way back to 1965. Is there any way to do this w/an excel formula.

Thanks,

Brett
 
How 'bout this:
=if(left(a1,4) = mid(a1,6,4),left(a1,4),a1)

[tt]_____
[blue]-John[/blue]
[/tt][red]Quidquid latine dictum sit, altum viditur[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Thank you very much anotherhiggins. This will save me alot of time.
 
[cheers]

[tt]_____
[blue]-John[/blue]
[/tt][red]Quidquid latine dictum sit, altum viditur[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Or, slightly simpler:
=if(left(a1,4) = right(a1,4),left(a1,4),a1)

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top