+ Reply to Thread
Results 1 to 9 of 9

'IF' mixup

  1. #1
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    'IF' mixup

    Hi.

    I'm trying to solve this:

    In C9

    IF D9 is empty AND C8 is empty THAN 1
    IF D9 is empty AND C8 is not empty THAN C8+1
    IF D9 is not empty AND C8 is empty THAN do nothing
    IF D9 is not empty AND C8 is not empty THAN do nothing

    The C column is a numerical counter and is suppose to auto increase depending on the D column having something or not. When it finds a D cell with data inside, than the corresponding C cell returns empty and auto resets the count. It should look something like this:
    example.jpg

    I know this much:
    IF D column has something THAN do nothing

    I started with =IF($D9="","1",""), but I know it's not enough so I tried to understand how 'IF AND' / 'IF OR' work, but I just can't figure it out... :/
    Help, please.

    P
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: 'IF' mixup

    Try:

    =IF(D9<>"", "", IF(C8="", 1, C8+1))

    Forgot to mention.... Do not put quotes around numbers if your intent is to treat them as numerical values. "1" with quotes is text; 1 without quotes is numeric. Although numeric text ("1" with quotes) works in numeric expressions, it is not always treated as numeric.
    Last edited by joeu2004; 09-06-2017 at 11:47 AM.

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: 'IF' mixup

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Re: 'IF' mixup

    Problem solved.
    Thank you.

    P

  5. #5
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Re: 'IF' mixup

    It returned #VALUE! (A value used in the formula is of the wrong data type.) error.

    P

  6. #6
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Re: 'IF' mixup

    Quote Originally Posted by kev_ View Post
    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It returned #VALUE! (A value used in the formula is of the wrong data type.) error.

    P

  7. #7
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Re: 'IF' mixup

    Quote Originally Posted by joeu2004 View Post
    Try:

    =IF(D9<>"", "", IF(C8="", 1, C8+1))

    Forgot to mention.... Do not put quotes around numbers if your intent is to treat them as numerical values. "1" with quotes is text; 1 without quotes is numeric. Although numeric text ("1" with quotes) works in numeric expressions, it is not always treated as numeric.
    Problem solved.
    Thank you.

    P

  8. #8
    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,661

    Re: 'IF' mixup

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    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.

  9. #9
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Re: 'IF' mixup

    Yes of course, forgot about that.
    P

+ 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 mixup day and month on different system...
    By crx4me in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-13-2014, 09:32 PM
  2. Replies: 1
    Last Post: 07-12-2012, 02:33 PM
  3. Mixup between thousand separator and decimal point in Eurpeean Excel.
    By Jiser001 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-02-2009, 05:11 AM
  4. Translation Mixup
    By mudraker in forum The Water Cooler
    Replies: 1
    Last Post: 11-01-2008, 09:11 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