+ Reply to Thread
Results 1 to 8 of 8

IF Formula?

  1. #1
    Registered User
    Join Date
    06-13-2015
    Location
    MANCHESTER, NH
    MS-Off Ver
    MS OFFICE EXCEL
    Posts
    3

    Unhappy IF Formula?

    I need to create a formula where if Cell G has certain text value, then Cell H is going to equal something. For example: If Cell G = SFS A, then Cell H = $20 Flat Fee, if Cell G= SFS B, then Cell H = $30 Flat Fee. Please Help!!!

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: IF Formula?

    Hi BETZY,
    Welcome to the forum.

    Create a lookup table somewhere on the sheet with all the possible texts and their corresponding values and then in col. G input texts and in col. H, use a Vlookup function to get the desired output based on the text in corresponding cell in col. G.

    If you are unable to work with this, please attach a sample workbook.
    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: IF Formula?

    Hi and welcome to the forum.

    One way

    =IF(G1="SFS A","$20 Flat Fee",IF(G1="SFS B","$30 FlatFee",""))

    But if you have a lot of values like SFS A, SFS B etc. you'd be better advised to create a table of these along with their associated results and use a VLOOKUP rather than many IF tests.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    06-13-2015
    Location
    MANCHESTER, NH
    MS-Off Ver
    MS OFFICE EXCEL
    Posts
    3

    Red face Re: IF Formula?

    Hello sktneer,

    Attached please find a sample of what I need. I have approximately 2,500 patients that I need to populate into this chart and I would like to once I add SFS A, SFS B, SFS C or Self Pay, the Fee Column to automatically populate by itself instead of me doing it manually.

    Thank You very much for your help!
    Betzy


    Quote Originally Posted by sktneer View Post
    Hi BETZY,
    Welcome to the forum.

    Create a lookup table somewhere on the sheet with all the possible texts and their corresponding values and then in col. G input texts and in col. H, use a Vlookup function to get the desired output based on the text in corresponding cell in col. G.

    If you are unable to work with this, please attach a sample workbook.
    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-13-2015
    Location
    MANCHESTER, NH
    MS-Off Ver
    MS OFFICE EXCEL
    Posts
    3

    Re: IF Formula?

    Hello Richard,

    I tried your formula, and it partially worked. For the SFS A it comes back fine, but for the B, I get a FALSE result. I've been trying and trying and I can't seem to get it right.

    Thank you for your help,
    Betzy

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: IF Formula?

    Hi

    Are you sure you have "SFS B" and not say "SFS B " with perhaps a trailing space.

    Upload the workbook so that we can check to see how you've implemented the formula.

  7. #7
    Registered User
    Join Date
    03-12-2014
    Location
    Central Texas
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: IF Formula?

    Using a table, with your 4 options in your example, you could use
    Please Login or Register  to view this content.
    easily. However, if something is inserted into the G-cell that is not on the table, it's going to throw an #N/A error at you.
    If you use Richard's code, only your options will give you a response, all others will stay blank.
    Please see the attached example, I have modified Cells G2:H4 with the formulas.
    Oh! I get it. I need rep--->҉

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: IF Formula?

    You dont really give is much to work on, but I agree with the other suggestions that you create a small table with your discount levels and relative fee, then use a vlookup to pull inteh answers.

    I would als add, that instread of having "$xx Flat Fee", you put the money (as a value) in 1 column, and the description in another column. That way, you can run calcs in the Fee if needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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: 11
    Last Post: 06-06-2014, 03:34 PM
  2. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

Tags for this Thread

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