+ Reply to Thread
Results 1 to 5 of 5

If A1 equals B1, add 1 to B1?

  1. #1
    Registered User
    Join Date
    06-03-2019
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    2

    If A1 equals B1, add 1 to B1?

    I'm trying to make a tic tac toe multiplayer game on Excel for a school assignment, and it's pretty basic but that's all I need it to be.

    What I'm trying to do is make a scoring system. Basically, if H1="Player 1 wins!", add one to cell B1. After they click a button to find a score, I want it to be able to lookup two cells and say Player 1 if cell B1>C1, but Player 2 if cell C1>B1. I understand how to do the last part, but the part that I'm finding super difficult is how to get the scores to be recorded in the first place. Every time I try to do it, it comes back with 0 or blank. My current thing I'm using is "=IF('Tic tac toe multiplayer'!H1="Player 1 wins!","M8+1","")", but that's just returning 0. (M8=0, it needed something to add to so I just gave it that, and the cell this is in is the overall score for Player 1)

    I've started to get comfortable using macros (but not VBA, that's scary), so if there are any suggestions with that, it would be ok.
    Thank you!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: If A1 equals B1, add 1 to B1?

    Welcome to the forum!

    As this is homework, we won't tell you the answer, rather just guide you.

    In an Excel formula, anything between speech marks is seen as text. Think carefully about what you want to return if the formula returns TRUE - look carefully at that part of the formula again.

    On the Formulas ribbon, use the Evaluate Formula feature to step through the formula you have created and see why ity might not be returning what you expect.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: If A1 equals B1, add 1 to B1?

    Quote Originally Posted by magicado View Post
    ...I've started to get comfortable using macros (but not VBA, that's scary)...
    They are pretty much the same thing

    The only way yo have a cell increase in value the way you want, would be to use VBA.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    06-03-2019
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    2

    Re: If A1 equals B1, add 1 to B1?

    I was talking about recording macros vs VBA. Recording is something I can do because it's just clicking, but VBA requires all this complicated stuff that I would prefer not to use, but if I have to I will.
    How would you suggest I use VBA to do this?

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: If A1 equals B1, add 1 to B1?

    According to google...
    Microsoft VBA is the programming language that Excel Macros are recorded in. VBA stands for “Visual Basic for Applications”. With VBA you can create visual basic macros for Excel. ... The truth is that while the Macro recorder is simple to use, it doesn't create nice code and it can only record straightforward tasks.
    Is VBA and Macros the same thing?
    They're basically the same thing: VBA is the language you use to program macros and functions. I'd guess technically the difference would be VBA code can contain both functions and macros where as a macro code is only the macro part of the code.

+ 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. If Cell Equals Text Then Cell Equals This Cell *
    By cellequals in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-19-2017, 10:23 PM
  2. Counting if 1 cell equals X and another equals Y
    By SianPE in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-08-2014, 06:39 AM
  3. if column B equals "cash" then column H equals 0
    By im3d in forum Excel General
    Replies: 4
    Last Post: 04-26-2011, 04:43 PM
  4. [SOLVED] if this equals that
    By MAML in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-06-2006, 03:45 PM
  5. if a:a (range) equals january and c:c equals gas then add g:g ($)
    By BCOz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-29-2005, 03:45 PM
  6. [SOLVED] IF equals this OR this
    By ellebelle in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. Replies: 1
    Last Post: 06-01-2005, 07:05 PM

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