+ Reply to Thread
Results 1 to 10 of 10

Calculation when cell contains a word

  1. #1
    Registered User
    Join Date
    10-13-2020
    Location
    Houston
    MS-Off Ver
    365
    Posts
    5

    Calculation when cell contains a word

    Hello,

    I am trying to do a calculation whereby the sum of two cells would be affected by a word in another cell.

    For example, "=I10-G20" let's say equals $50.00. Then if a cell on the same line has the word "hello" I want to minus a fee that the word "hello" imposes on the sum I calculated. So I am trying to subtract a say, $0.0000221 from the sum that =I10-G20 calculated if the word "hello" is in cell N.

    Any idea how to do this?

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Calculation when cell contains a word

    Welcome to the forum.

    You can use something like this:

    =IF(OR(I10="",G20=""),"",I10-G20-IF(N20="hello",0.0000221,0))

    It would help in future if you attached a sample Excel workbook, so we can see the problem in context. The yellow banner at the top of the screen gives details of how to do this.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-13-2020
    Location
    Houston
    MS-Off Ver
    365
    Posts
    5

    Re: Calculation when cell contains a word

    Hi Pete,

    Thanks for the response. Absolutely appreciate it. So I tried that and got the same answer as I originally had, but in the negative.

    So here is the scenerio. So I do a little trading. Company YYYYY charges me the following fees for every Sell I do:

    $0.0000221 *Total $ Trade
    $0.000119 * Total Trade Volume

    I have attached my excel file. So you if you look at the first charge, $0.0000221 * Total $ Trade which is column (J3). I get charged $0.0160888 for the $728 worth of trades, and 200*0.000119 for the volume (F3)of trades I sold which is 200 amounting to $0.0238. I cannot figure out how to have excel create these two calculations if cell N3 shows YYYYYY.

    I am supposed to land up with $57.96, not $58.00, since YYYYYY charges me $0.0160888 from J3 (Total Trade), and $0.0238 from F3 (Total Trade Volume or Shares Sold). So in the end, cell L3 is suppose to show a total of $57.96

    I hope this makes sense. Any suggestions?

    Cheers!
    Attached Files Attached Files

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Calculation when cell contains a word

    Try:

    Please Login or Register  to view this content.
    Quang PT

  5. #5
    Registered User
    Join Date
    10-13-2020
    Location
    Houston
    MS-Off Ver
    365
    Posts
    5

    Re: Calculation when cell contains a word

    Thanks, Bebo. Almost there. The answer I get is $57.93, but I should get $57.96, so it's off by 3 cents.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,535

    Re: Calculation when cell contains a word

    When I put bebo's formula into cell L2 and drag the fill handle down to cell L3 the value 57.96 is displayed.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    10-13-2020
    Location
    Houston
    MS-Off Ver
    365
    Posts
    5

    Re: Calculation when cell contains a word

    JeteMc.

    Yeah, it works if there is something other than YYYYYY in L2. The N2="YYYYYY" is the issue.

    I have attached a new sheet for you to see what I mean using Investor 1 and Investor 2 as examples. The answer should be -$2.78

    It is not recognizing that only when N2 = Investor 1, only then should it do the calculation.

    Play around with it and you will see what I mean.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,535

    Re: Calculation when cell contains a word

    Please take a look at the formulas in cells L2:L3 (file attached to post #7) as they are different.
    I believe that if you'll drag the from in cell L2 down to cell L3 you'll see that the formula is conditional to the value in the trade account column.
    Let us know if you have any questions.

  9. #9
    Registered User
    Join Date
    10-13-2020
    Location
    Houston
    MS-Off Ver
    365
    Posts
    5

    Re: Calculation when cell contains a word

    Awesome! Thanks! That worked!! You guys rock!

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,535

    Re: Calculation when cell contains a word

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

+ 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. [SOLVED] Show Calculation Formulas from Excel in Word
    By CSFitzgerald in forum Excel General
    Replies: 2
    Last Post: 06-26-2019, 10:46 AM
  2. Add a word before a calculation
    By doggax99 in forum Excel General
    Replies: 12
    Last Post: 03-21-2019, 10:51 AM
  3. [SOLVED] Calculation of dates and leaving blank cell when calculation sees non-date values
    By Hedy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-22-2018, 07:52 AM
  4. Calculation in Excel Embedded in Word
    By Compstuff in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-13-2017, 11:32 AM
  5. Word calculation with mailmerging
    By aaaaaaiden in forum Word Formatting & General
    Replies: 4
    Last Post: 09-30-2013, 06:55 PM
  6. Check cell for word, If word exists in cell, assign that cell to corresponding category.
    By Trevasaurus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2012, 12:35 PM
  7. Replies: 3
    Last Post: 11-12-2010, 02:39 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