+ Reply to Thread
Results 1 to 7 of 7

Add "IF" to existing "MOD" cell forumla

  1. #1
    Registered User
    Join Date
    05-25-2013
    Location
    Yonkers NY
    MS-Off Ver
    Excel 2010
    Posts
    28

    Add "IF" to existing "MOD" cell forumla

    I have a formula in cell "M4", "=MOD($D$30+'Admin Data'!$B$9,1)" that is formatted for time (This is an Overtime program). Is there a way to add to the formula that if Cell J12 = "Off" that "Off" will appear in cell "M4"? Thank you.
    Last edited by chriswhite1982; 06-18-2013 at 05:48 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,712

    Re: Add "IF" to existing "MOD" cell forumla

    try this:

    =if(J12="Off","Off",MOD($D$30+'Admin Data'!$B$9,1))
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    05-25-2013
    Location
    Yonkers NY
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Add "IF" to existing "MOD" cell forumla

    Thank you so much Alansidman! It works great.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,248

    Re: Add "IF" to existing "MOD" cell forumla

    Depends if J12 can have other values.

    If J12 is blank or "yes", then just:

    cell M4, =MOD($D$30+'Admin Data'!$B$9,1) & " " & $J$12

    or

    cell M4, =$J$12 & " " & MOD($D$30+'Admin Data'!$B$9,1)


    If J12 could be Yes or No, then maybe:

    cell M4, =MOD($D$30+'Admin Data'!$B$9,1) & IF($J$12="yes", " " & $J$12, "")


    If it's an either/or

    cell M4, =IF($J$12="yes", $J$12, MOD($D$30+'Admin Data'!$B$9,1))


    Anyway, some options to consider.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,248

    Re: Add "IF" to existing "MOD" cell forumla

    If you intend to drag the formula down the column, you may want to make the cell reference absolute: $J$12

    Regards, TMS

  6. #6
    Registered User
    Join Date
    05-25-2013
    Location
    Yonkers NY
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Add "IF" to existing "MOD" cell forumla

    Thank you TMShucks!

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,248

    Re: Add "IF" to existing "MOD" cell forumla

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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