+ Reply to Thread
Results 1 to 9 of 9

Can I use the IF function to multiply and divide?

Hybrid View

  1. #1
    Registered User
    Join Date
    09-06-2008
    Location
    UK
    Posts
    17

    Can I use the IF function to multiply and divide?

    I am needing to multiply E5 by 4, then if N44 is <150 I need to divide E5 by 3.33, if N44 is less than 300 I need to divide by 2.50 and if it is more then 300 I then need to divide by 1.66. This formula will go into J66 and I need the results to appear as X Hours.

    Is it possible to do this I have played about a little but this is beyond my knowledge. Thanks.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Hi Carolan,

    You sure, can, for example:

    =IF(N44<150,E5/3.33,IF(N44<300,E5/2.5,E5/1.66)

    This says:

    IF N44 is less than 150 then divide E5 by 3.33, otherwise IF N44 is less than 300 then divide E5 by 2.5, otherwise IF N44 does not fit into the previous values (any # greater than or equal to 300) then divide E5 by 1.66.

    You can then format J66 to appear as hours.

  3. #3
    Registered User
    Join Date
    09-06-2008
    Location
    UK
    Posts
    17
    That works perfect if I do the multiply sum for E5 into cell P1, I am trying to add the word HOURS on the end not am/pm (sorry my fault should have said) in the format cell section I can't see a way to add anything to the end.

    Thank you for the formula though...I did get close just not close enough he he he

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    To add "hours" at the end, you could try:

    =IF(N44<150,E5/3.33&" hours",IF(N44<300,E5/2.5&" hours",E5/1.66&" hours")

  5. #5
    Valued Forum Contributor
    Join Date
    08-26-2008
    Location
    singapore
    Posts
    626
    Paul, why not make it simpler

    
    =IF(N44<150,E5/3.33,IF(N44<300,E5/2.5,E5/1.66))&" hours"
    I need your support to add reputations if my solution works.


  6. #6
    Registered User
    Join Date
    09-06-2008
    Location
    UK
    Posts
    17
    These both work but the formatting applied to the cell (to get rid of all decimals) doesn't work with Hour in the cell. I think I will look at putting it in cell next to it or something. Thanks to you both

  7. #7
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Can I use the IF function to multiply and divide?

    The '&' is making the value into a text. I do not prefere that as you might want to use the value somewhere else. Therefore use cell format.

    Format Cells, Custom, 0 " hours"
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  8. #8
    Registered User
    Join Date
    09-06-2008
    Location
    UK
    Posts
    17
    That one worked perfect thanks you.

  9. #9
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re:Can I use the IF function to multiply and divide?

    carolan, Do noy give up that easily. We don't ...

+ 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. Update from one workbook to another
    By dvspriest in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-08-2008, 09:50 PM
  2. Divide all cells by 100
    By Tnesper in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-03-2008, 08:57 PM
  3. "If" function with drop down
    By chrisja in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-28-2008, 04:07 PM
  4. passing multiple values to/from a function
    By mwc0914 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2007, 04:07 PM
  5. divide hours
    By emorocks83 in forum Excel General
    Replies: 2
    Last Post: 11-14-2006, 11:33 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