+ Reply to Thread
Results 1 to 13 of 13

Formula to make "word" equal "numeric value"

Hybrid View

  1. #1
    Registered User
    Join Date
    10-03-2018
    Location
    Rio de Janeiro, Brasil
    MS-Off Ver
    2010
    Posts
    7

    Question Formula to make "word" equal "numeric value"

    Hello, I am very new to Excel, and had my Boss help me since he liked teaching basic things. He once helped me turn WORD into VALUE in two separate columns.

    I am trying to make "SUBWAY" equal "4.30"

    and "BUS" equal "3.90"

    what I want is the H4=G4+B4
    this would mean that subway(G4) + subway(B4) would = 8.60(H4)
    Being that on certain days it can vary from 2 subway or 1 subway and 1 bus.



    he used a very simple way without VLOOKUP or anything of that kind, from what i can remember it was something with a rule, not a formula, but i am open to any solution, His Rule was somehwere i cannot seem to find, but it was basically "WORD" = "VALUE"


    Pictures Below,

    Thanks for all the help, every comment is appreciated, i have searched not only this forum, but youtube, and google.

    Also hope i was able to explain myself without confusing everyone, my question might seem odd, but im still getting the hang of the short cuts and formulas.
    P.S. Im using Excel 2010, also I previewed the post and could not find a way to make the images smaller.

    UPDATE: I have tired Samba_ravi and Entregans solution, for some reason its giving me various errors, I have posted the file as PRODRIGUES,
    If anyone would care to try, because maybe I have done something wrong, thank you very much.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by PEDRO728; 10-03-2018 at 09:42 AM. Reason: adding document

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Formula to make "word" equal "numeric value"

    May be name manager will do the trick
    Do the following
    Press Ctrl+F3 >
    Click on New >
    Enter Subway in Name and 4.3 in Refers to >
    Press OK

    Do the same for Bus and others
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Registered User
    Join Date
    10-03-2018
    Location
    Rio de Janeiro, Brasil
    MS-Off Ver
    2010
    Posts
    7

    Re: Formula to make "word" equal "numeric value"

    Quote Originally Posted by samba_ravi View Post
    May be name manager will do the trick
    Thanks samba_ravi, yes I tried the name manager but unfortunately, it did not work for me .
    Last edited by AliGW; 10-03-2018 at 09:47 AM.

  4. #4
    Registered User
    Join Date
    01-28-2015
    Location
    TX, USA
    MS-Off Ver
    2013
    Posts
    69

    Re: Formula to make "word" equal "numeric value"

    For the Formula based answer make sure the cells in that row are the the Currency Format>Select Cell Range. (H4:H34) in you case.
    For your specific situation

    Solution #1
    =IFERROR(SUM(IF(B4="Subway",VALUE(SUBSTITUTE(B4,"Subway","$4.30")),IF(B4="Bus",VALUE(SUBSTITUTE(B4,"Bus","$3.90")),"")),IF(G4="Subway",VALUE(SUBSTITUTE(G4,"Subway","$4.30")),IF(G4="Bus",VALUE(SUBSTITUTE(G4,"Bus","$3.90"))))),"")
    After you have completed this, drag and fill the formula all the way down.

    Function Explanations

    IFERROR
    IFERROR(FUNCTION_OR_FUNCTIONS,RESULT_IF_FUNCTION(S)_RETURN_AN_ERROR_CODE)
    SUM
    =SUM(
    IF
    =IF(TEST,IF_TRUE,IF_FALSE)
    VALUE
    =VALUE(TEXT_STRING)
    SUBSTITUTE
    =SUBSTITUTE(CELL_REFERENCE,TEXT_TO_REPLACE,TEXT_TO_REPLACE_ORIGINAL_TEXT,[NUMBER_OF_TIMES_TO_REPLACE_OLD_TEXT])
    Section of code enclosed with [] defaults to all instances of "Subway" within the referenced Cell.

    Evaluation of the Separate Functions
    The VALUE function changes text into a number format
    =VALUE()
    The text can be manually entered: "$4.30"

    or

    The text can be referenced by address: B4
    (Since 'B4' is still text, the value function still needs to replace the text with the desired number.)

    So...

    Inside the VALUE Function, the SUBSTITUTE function changes your text into the appropriate number.
    Part 1,
    =SUBSTITUTE(B4,
    Targets Cell Address B4.

    Friendly Reminder:Remember to use $ to lock column or row ($B4/B$4/$B$4), if you want to repeat the result of specific cells or Absolute Locations.
    Not that I could foresee why you would want to.



    Part 2,
    "Subway",
    Looks for the word Subway.
    The text within the quotes is case sensitive.


    Part 3,
    "$4.30"
    Changes the text Subway into $4.30
    (Which gives VALUE a text number, to convert into a Value that it can use mathematically.)

    Part 4,
    ,2)
    The number 2, will look for "Subway" two times within the referenced cell (B4)
    But, we don't this this particular bit of information.

    So the finished product of this function is...
    =SUBSTITUTE(B4,"Subway","$4.30")
    Note that part 4 is absent

    And that is the long answer to your problem.

    A simpler but less versatile code, as it requires a single match (Though it should work for your purposes.

    Solution #2
    =IF(B4="Subway",$4.30,IF(B4="Bus",$3.90,0))+IF(G4="Subway",$4.30,IF(G4="Bus",$3.90,0))
    An easier way still would be to Put the words into separate cells, and reference them in the formulas, instead of the direct words.

    Solution #3
    L1="Subway"
    L2="Bus"
    =IF(B4=$L$1,4.3,IF(B4=$L$2,3.9,0))+IF(G4=$L$1,4.3,IF(G4=$L$2,3.9,0))
    Alternatively, if you prefer the sum function, use as per normal with the contained if statements in either of the above.

  5. #5
    Registered User
    Join Date
    10-03-2018
    Location
    Rio de Janeiro, Brasil
    MS-Off Ver
    2010
    Posts
    7

    Re: Formula to make "word" equal "numeric value"

    Thanks, Entregan,
    I tried all three formulas and also I tried to do them step by step, for some reason im not being successful in getting it right. I will keep trying in the mean time. I will post the file link above, maybe if youre able to edit it in for me and then you can see what the problem is, if not I still appreciate the help and will continue in trying to resolve this, and do your step by step again.
    Last edited by AliGW; 10-03-2018 at 09:47 AM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,068

    Re: Formula to make "word" equal "numeric value"

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    10-03-2018
    Location
    Rio de Janeiro, Brasil
    MS-Off Ver
    2010
    Posts
    7

    Re: Formula to make "word" equal "numeric value"

    Thank you! should I delete the posts which I quoted?

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,068

    Re: Formula to make "word" equal "numeric value"

    Quote Originally Posted by PEDRO728 View Post
    Thank you! should I delete the posts which I quoted?
    No - I have deleted the unnecessary quotations for you.

    In future, please only quote another post if your answer is out of sequence, as I am doing now, and if you do, keep the quoted section as short as possible. I have had to remove another quotation you made since responding to my request!

  9. #9
    Registered User
    Join Date
    01-28-2015
    Location
    TX, USA
    MS-Off Ver
    2013
    Posts
    69

    Re: Formula to make "word" equal "numeric value"

    Hey Pedro. The reason you weren't successful seems to be that you didn't match the case of the word.
    If the Plan in cell B4 says "SUBWAY" then any SUBSTITUTE function also needs to say "SUBWAY"
    If Cell B4 says "subway" then function should match with "subway"
    and also "SuBwAy" should read "SuBwAy" inside the SUBSTITUTE function.

    Hope that helps.

  10. #10
    Registered User
    Join Date
    10-03-2018
    Location
    Rio de Janeiro, Brasil
    MS-Off Ver
    2010
    Posts
    7

    Re: Formula to make "word" equal "numeric value"

    THANK YOU! I really appreciate it , yes that did solve my issue. I still didn't learn how to do it, but slowly I will try to get the hang of it, I really appreciate it.
    Last edited by AliGW; 10-03-2018 at 12:50 PM. Reason: Another unnecessary quotation removed.

  11. #11
    Registered User
    Join Date
    01-28-2015
    Location
    TX, USA
    MS-Off Ver
    2013
    Posts
    69

    Re: Formula to make "word" equal "numeric value"

    At the top of the Thread, above your post and to the right, there is a link "Thread Tools". Click it to open a menu and select "Mark thread as Solved."

  12. #12
    Registered User
    Join Date
    10-03-2018
    Location
    Rio de Janeiro, Brasil
    MS-Off Ver
    2010
    Posts
    7

    Re: Formula to make "word" equal "numeric value"

    how do I mark this as solved? and what else should I do ? I have gaven all of you good reputation if that helps with anything!

  13. #13
    Registered User
    Join Date
    01-28-2015
    Location
    TX, USA
    MS-Off Ver
    2013
    Posts
    69

    Re: Formula to make "word" equal "numeric value"

    Glad to help! We all have to start somewhere. I started by working with the help function (Hotkey: F1) and the IF() function. Good luck!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  3. Replies: 5
    Last Post: 01-23-2014, 11:02 AM
  4. [SOLVED] Cell Formula to count time with "Greater Than or Equal to" and "Less Than"
    By chriswhite1982 in forum Excel General
    Replies: 3
    Last Post: 06-16-2013, 12:30 AM
  5. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 AM
  6. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  7. If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ...
    By Maria J-son in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2006, 08:25 AM

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