+ Reply to Thread
Results 1 to 8 of 8

Excel Formula If, else, Not Equal

  1. #1
    Registered User
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2003
    Posts
    4

    Excel Formula If, else, Not Equal

    Hello Excel Forum,

    I am new to the forum and basically new to Excel formulas outside of the basic sum and average functions I used in university. I do have a background in Computer Science and programming and I think my logic is alright though, but I cannot get the formula to output.

    I have to columns of data. They are F2 and J2. I am basically trying to get a list of transactions from J2 forward. Where F2 is the current transaction. So if F2 does not equal J2 then the formula should output F2 into J2. If F2 equals J2, then move on and output J2 instead.


    I have tried the following:

    If(F2<>J2, F2,J2) and I get circular reference
    I have tried

    If(Not(F2=J2),F2,J2) and I get a circular reference

    The only thing I think that might cause issue is that I changed cells formatting to Currency. Would that an effect on the formula?


    Thanks, Sorry if this has been asked in different area or formatting sucks.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: Excel Formula If, else, Not Equal

    In order for what you are trying to do, you will need to use a VBA solution. Excel cannot have a formula in a cell that it references, hence the circular reference. So it you provide a sample worksheet with some data, I am sure that we can supply you with a workable VBA solution.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    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
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Excel Formula If, else, Not Equal

    Hi,

    Welcome to the forum.

    Can u post a workbook with sample data? Also, would like to know what is the data type for the contents in column F and J.
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  4. #4
    Registered User
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel Formula If, else, Not Equal

    Hi guys/gals

    Thanks for the quick response. I avoided adding my data because I did not want to blatantly ask for code or overwhelm the forum and put a bad taste in anyone's mouth.

    Basically in response to the moderator. I have 10 columns. After each transaction I want to add the transaction total from Column F(Current Purchase) to the correct Transaction Column. So if it is the first transaction it would go into column for transaction 1. Second current purchase entry goes into Transaction 2 column and so on and so forth.

    I have added the workbooks to this post. The type for F2 and J2 are currency if that is what you are asking.

    Thanks for the warm welcomes and help.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel Formula If, else, Not Equal

    So I tried to build some VBA code. Maybe you guys could take a look at it?

    Please Login or Register  to view this content.
    I get a runtime error 1004: application-defined or object defined error

    Any thoughts?

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: Excel Formula If, else, Not Equal

    Which line of code is highlighted when you click on debug when you get the error?

  7. #7
    Registered User
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel Formula If, else, Not Equal

    So I fixed some code. After some work and fiddling and some help from stackoverflow I have two options:

    Please Login or Register  to view this content.
    And I get runtime error 13 at this line:
    Please Login or Register  to view this content.
    If this does not work I will post the other code that was recommended that works, but does not do exactly as I anticipated.

    Thanks for the help

  8. #8
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Excel Formula If, else, Not Equal

    Hi,

    This line:
    Please Login or Register  to view this content.
    seems wrong... I think when you have to specify ranges you can either have:
    J:J or J1:J10 - You're trying to define a range using incorrect syntax.

    Try putting:
    Please Login or Register  to view this content.

+ 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. excel 2010 help, formula for a value to equal another value.
    By fbrg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-24-2013, 05:30 PM
  2. How to give Greaterthan or equal formula in excel?
    By jitendrafaye in forum Excel General
    Replies: 1
    Last Post: 05-02-2011, 01:20 AM
  3. how do i get the equal sign on my formula bar in excel
    By Bigfoot in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-20-2006, 07:30 AM
  4. [SOLVED] How do I make a column equal a formula in Excel?
    By archllama in forum Excel General
    Replies: 7
    Last Post: 04-10-2006, 07:38 PM
  5. Excel formula to make AAA-BBB equal to/consistent with BBB-AAA
    By AliceJDavidson in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-09-2005, 05:06 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