+ Reply to Thread
Results 1 to 10 of 10

Compare 2 cells to calculate a third cell

  1. #1
    Registered User
    Join Date
    08-27-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Cool Compare 2 cells to calculate a third cell

    I am just getting into excel vba.
    Is there a way to compare 2 cell values , and if a condition is met do a calculaion in a third cell?

    I want to do this for a range of cell from top to bottom
    Thanks for any help you can proivide.
    I thave the excel vba for dummies but I think I am too dumb to fully understand it

    Thanks
    Last edited by lboyd; 08-31-2010 at 08:54 AM. Reason: Wrong Title

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

    Re: newbe help

    Welcome to the forum,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST
    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 Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: newbe help

    Hi,

    There are probably a few ways to do it.

    Can you provide a sample of what you are trying to achieve in a sample workbook?

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: newbe help

    How about something like:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-27-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: newbe help

    Quote Originally Posted by Domski View Post
    Hi,

    There are probably a few ways to do it.

    Can you provide a sample of what you are trying to achieve in a sample workbook?

    Dom
    I don't know if this will post right but the logic is
    If Cell Colum F is greater than Cell Colum D put the percentage difference(formula) in cell Colum G

    A B C D E F G
    Division Type Number Last Year Number This year Percent difference
    VMB
    DOMESTIC 74 $109021.33 33 $44538.56 55%
    REPAIR/REBUILD 3 $14081.00 4 $10258.00 -33%
    VMB TOTAL 77 $123102.33 37 $54796.56 52%


    Thanks

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: newbe help

    Please change your thread title as NBVC requested!

    Dom

  7. #7
    Registered User
    Join Date
    08-27-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Compare 2 cells to calculate a third cell

    This is what I was trying to do but this does not work.


    Please Login or Register  to view this content.
    Last edited by lboyd; 08-30-2010 at 01:47 PM. Reason: code not quoted

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

    Re: Compare 2 cells to calculate a third cell

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  9. #9
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: Compare 2 cells to calculate a third cell

    Can you post a sample file where you get the error?

  10. #10
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Compare 2 cells to calculate a third cell

    Try:

    Please Login or Register  to view this content.

    Dom

+ 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