+ Reply to Thread
Results 1 to 5 of 5

Divide columns with an if

  1. #1
    Registered User
    Join Date
    11-11-2010
    Location
    Hatboro, PA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Divide columns with an if

    I am trying to divide column f by column z. If column f is 0 then I want column h to be divided by column z. I am a complete novice at macros, but I thought I would give it a try. I can't seem to make anything work.

    This is probably really easy... any help?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Divide columns with an if

    Are you sure you are looking for a macro or are you looking for a formula?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Divide columns with an if

    Do you mean the sum of column f? Or a specific cell in column f? Need some more specifics to be able to help you. Doubt you need a macro though. A formula will probably work fine.

  4. #4
    Registered User
    Join Date
    11-11-2010
    Location
    Hatboro, PA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Divide columns with an if

    Quote Originally Posted by NBVC View Post
    Are you sure you are looking for a macro or are you looking for a formula?
    I was looking at possibly doing a macro just as some experience. But if you think its pointless, I would be glad to know your thoughts on a formula for this instead.

    Thanks.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Divide columns with an if

    Formula, based on checking on a row per row basis would be something like:

    =IF(F2=0,H2/Z2,F2/Z2) copied down assuming starting at row 2.

    If you need a macro, I am sure a VBA expert can assist....

+ 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