+ Reply to Thread
Results 1 to 16 of 16

SUBSTITUTE formula giving unexpected result

  1. #1
    Registered User
    Join Date
    06-04-2012
    Location
    FL
    MS-Off Ver
    Excel 2010
    Posts
    5

    SUBSTITUTE formula giving unexpected result

    I have an assignment for class that requires me to do certain things in excel and after working on it for around 15 hours or so didn't have any issues until I got to the SUBSTITUTE formula. Basically there is a table with an address column and we are to use the SUBSTITUTE formula to replace "Dr" with "Drive". I figured simple enough, this will be another one of those 30 second parts. 3 or 4 hours later I think I am losing it.

    So in cell D18 it currently has "20511 Lake Forest Dr" and when I use the formula =SUBSTITUTE(D18,"Dr","Drive") it puts "0" in the cell instead of what I would expect. If I copy the entire address column to a blank column, say L for example, and use L18 in the formula instead of D18 in cell D18 it works, but I suspect this is not what the professor wants. Any help would be greatly appreciated.
    Last edited by gkeller81; 06-04-2012 at 11:18 AM. Reason: inappropriate title

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: SUBSTITUTE formula driving me crazy

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Never use Merged Cells in Excel

  3. #3
    Forum Contributor
    Join Date
    02-07-2012
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    172

    Re: SUBSTITUTE formula driving me crazy

    Quote Originally Posted by gkeller81 View Post
    I have an assignment for class that requires me to do certain things in excel and after working on it for around 15 hours or so didn't have any issues until I got to the SUBSTITUTE formula. Basically there is a table with an address column and we are to use the SUBSTITUTE formula to replace "Dr" with "Drive". I figured simple enough, this will be another one of those 30 second parts. 3 or 4 hours later I think I am losing it.

    So in cell D18 it currently has "20511 Lake Forest Dr" and when I use the formula =SUBSTITUTE(D18,"Dr","Drive") it puts "0" in the cell instead of what I would expect. If I copy the entire address column to a blank column, say L for example, and use L18 in the formula instead of D18 in cell D18 it works, but I suspect this is not what the professor wants. Any help would be greatly appreciated.
    Surely you just use the find and replace tool?

    click edit > find > replace >

    find Dr

    Replace with Drive

    Replace all

    If thats what you want

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: SUBSTITUTE formula driving me crazy

    Your post does not comply with Rule 7 of our Forum RULES. Please do not ignore Moderators' or Administrators' requests - note that this includes requests by senior members as well, if you are unclear about their request or instruction then send a private message to them asking for help. Do not post a reply to a thread where a moderator has requested an action that has not been complied with e.g Title change or Code tags...etc

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: SUBSTITUTE formula driving me crazy

    spursrule, I will restore your question once that user post a propper title.

  6. #6
    Registered User
    Join Date
    06-04-2012
    Location
    FL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: SUBSTITUTE formula giving unexpected result

    Spursrule, I can see your question in my email and I would love to use that option, but the assignment specifically requires the use of the SUBSTITUTE formula to achieve the desired outcome.

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,603

    Re: SUBSTITUTE formula giving unexpected result

    Isn't the idea behind homework that you solve the problem yourself?

  8. #8
    Registered User
    Join Date
    06-04-2012
    Location
    FL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: SUBSTITUTE formula giving unexpected result

    I have been trying to figure it out for hours. I think the idea behind homework is to learn, regardless of whether or not it requires outside help.

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,603

    Re: SUBSTITUTE formula giving unexpected result

    You've got a point - Have you tried the Evaluate formula feature to see what happens ? Otherwise post a small sample of your real data

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: SUBSTITUTE formula giving unexpected result

    Are you trying to enter SUBSTITUTE formula in cell D18 where is text that you want to change?

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SUBSTITUTE formula giving unexpected result

    Quote Originally Posted by gkeller81 View Post
    So in cell D18 it currently has "20511 Lake Forest Dr" and when I use the formula =SUBSTITUTE(D18,"Dr","Drive") it puts "0" in the cell instead of what I would expect. If I copy the entire address column to a blank column, say L for example, and use L18 in the formula instead of D18 in cell D18 it works, but I suspect this is not what the professor wants. Any help would be greatly appreciated.
    interesting... can you upload a sample workbook showing this happening.

    I am not sure if that is a problem with 2010. I tried it in 2007 and it works fine.... I don't have 2010 here, but I or others can test for you to see if it is something with your spreadsheet or with your version.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  12. #12
    Registered User
    Join Date
    06-04-2012
    Location
    FL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: SUBSTITUTE formula giving unexpected result

    Attached is the spreadsheet. The issue is in the Address column (F). Trying to replace "Dr" with "Drive". Zbor - I am entering the formula in the cell I want the text changed in. Thanks for the replies.
    Attached Files Attached Files

  13. #13
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,603

    Re: SUBSTITUTE formula giving unexpected result

    2010 is OK

  14. #14
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: SUBSTITUTE formula giving unexpected result

    Your attachment pops up an error "Contains unreadable content ....trusted source.....".

  15. #15
    Registered User
    Join Date
    06-04-2012
    Location
    FL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: SUBSTITUTE formula giving unexpected result

    Not sure why that is. Attached again.
    Attached Files Attached Files

  16. #16
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SUBSTITUTE formula giving unexpected result

    So where are you putting the formula....you can't put them in the same cell as the actual address you are trying to change.... and it looks like your addresses are in column F not D

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1