Combining IF and RIGHT functions in excel

sgregory picture sgregory · Nov 22, 2017 · Viewed 15.4k times · Source

I'm a super novice, trying to navigate data analysis in Excel, so be kind! I need to combine the IF and RIGHT functions.

So it's a sales dataset with different products, I need to use the IF function to filter the products so it only applies to "Bikes". Then I need the last 2 characters of the Product Name column which represents the size of the bike.

I've got the RIGHT function to work by itself but I can't combine it with the IF function so it only applies to the bike products.

=RIGHT(L2,2)

If this makes sense to anyone please help!

Answer

Evan Callahan picture Evan Callahan · Nov 22, 2017
=IF(LEFT(A1, 5) = "Bikes", RIGHT(A1, 2), "")

Then just copy this down the range of your data.