+ Reply to Thread
Results 1 to 12 of 12

Conditional Formatting to multiply a cell

  1. #1
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Conditional Formatting to multiply a cell

    Trying to figure out how to multiply a cell by 2 if a different cell has an "x" or any character for that matter.

    Example-- I want L2 to take the value of F2, add the value of G2*1.5 and then if H2 had an "x", then multiply F2 by itself.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional Formatting to multiply a cell

    Maybe:

    =F2+(G2*1.5)+((LEN(H2)>0)*F2)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Conditional Formatting to multiply a cell

    Okay, that at least gives me a value... the wrong value, but a value nonetheless... it's giving me 122:52

    it should be like 19:21 or something similar. Any ideas? Thanks!

    Edit: I see the problem is in the G column... it's getting confused somehow.
    Last edited by nkitchen31; 07-05-2016 at 02:34 PM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional Formatting to multiply a cell

    How did you get 19:21?

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional Formatting to multiply a cell

    Is this related to your other thread ?

    http://www.excelforum.com/excel-form...ding-time.html

  6. #6
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Conditional Formatting to multiply a cell

    Jonmo1: Yes it is...

    Excel is getting confused because it think's its a day and time, and not hours and minutes.

    Well, if I put "3" under Days MUP it should take F2 and add (3*1.5) and get 4.5+7:26 which is 11:56... or if there is an X in the JUM column then it should be 7:26 * 2 which is 14:52... but if I have an X in the JUM column and 3 in the Days MUP Column, it would be:

    (7:26*2)+(3*1.5) which is 19 and change...

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional Formatting to multiply a cell

    You can combine the solution I provided in the other thread, with what JBeaucaire posted

    =F2+(G2*1.5/24)+((LEN(H2)>0)*F2)

  8. #8
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Conditional Formatting to multiply a cell

    OH MY GOSH thank you so much!!! That's perfect!
    Last edited by nkitchen31; 07-05-2016 at 02:55 PM.

  9. #9
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Conditional Formatting to multiply a cell

    Maybe I need another thread, but I have another question... If I have an "X" in TXR, SIC, or VAC column, I want to take the value of the respective F cell and keep a total in row 16. Does that make sense?

    Like, if I have an X under VAC for K4 and K5, I want K16 to be F4+F5.

    Thanks again guys!

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional Formatting to multiply a cell

    You're welcome.


    FYI, the basic problem you've had is nut fully understanding how Excel handles Dates and Times.

    DATES are whole numbers, incrimenting by 1 since Jan 1 1900
    1 = Jan 1 1900
    32 = Feb 1 1900
    etc
    42556 = Jul 5 2016

    TIME is the Decimal value of a number. A FRACTION of 1 day.
    1 hour = 1/24 or 0.041667
    6 AM is 6 hours, or 6/24, or 0.25

    So when you had the whole number 6 in G6, it was adding 6 DAYS (144 hours, 6*24), not 6 Hours.

  11. #11
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional Formatting to multiply a cell

    Try

    =SUMIF(K$2:K$14,"X",$F$2:$F$14)

  12. #12
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Conditional Formatting to multiply a cell

    Ahhhh I see now... thanks for the explanation.

    And, brilliant! Works like a charm. Truly time savers guys, thanks again.

+ 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] Multiply Column by Constant & Cell Formatting
    By btone in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2015, 02:26 PM
  2. Replies: 3
    Last Post: 11-04-2013, 12:47 AM
  3. [SOLVED] Multiply, Divide and Then Multiply in a cell
    By Brownie2576 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-22-2012, 08:57 PM
  4. Delete Conditional Formatting conditions but keep cell formatting - Excel 2010
    By tetreama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 08:28 PM
  5. Replies: 3
    Last Post: 05-15-2012, 04:13 PM
  6. Replies: 1
    Last Post: 03-05-2012, 06:20 PM
  7. Macro for formatting fonts and cell colours - not Conditional Formatting
    By Kayaness in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2011, 03:46 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