If formula not working right

zone709

Well-known Member
Joined
Mar 1, 2016
Messages
2,129
Office Version
  1. 365
Platform
  1. Windows
Hi trying to get this to work, but returns nothing blank. What am I missing? If name is present return that number ,1 ,2 or ,3

=IF(R2="Yard",1,IF(R2="Yards",2,IF(R2="Tunnel",3,"")))
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi trying to get this to work, but returns nothing blank. What am I missing? If name is present return that number ,1 ,2 or ,3

=IF(R2="Yard",1,IF(R2="Yards",2,IF(R2="Tunnel",3,"")))
If those are only 3 options to be in r2
=if(r2="Yard",1,if(r2="Yards",2,3))
Maybe strings are not alone in cell?
 
Last edited:
Upvote 0
Im not sure. In Cell R formula is pulling in the name. Can that be it?
 
Upvote 0
Wait the Trim formula is working now thanks. I figured it out thanks for all the help again
 
Upvote 0
Type =len(R2) into another cell, see if it returns the correct number of characters
 
Upvote 0
There is as shorter formula, that doesn't need nested IFs though.

=IFERROR(MATCH(TRIM(R2),{"Yard","Yards","Tunnel"},0),"")
 
Last edited:
Upvote 0
HI I came back here cause I cant get rid of this return "

If nothing returns right instead of returning blank cell like I think its suppose to. It returns " Anyone know why this returns "

Thanks


=IF(TRIM(E15)="Yard",1,IF(TRIM(E15)="Yards",2,IF(TRIM(E15)="Tunnel",3,IF(TRIM(E15)="River",4,""""))))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,173
Members
453,021
Latest member
Justyna P

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