+ Reply to Thread
Results 1 to 8 of 8

if is number or 0

  1. #1
    Registered User
    Join Date
    03-29-2020
    Location
    cyprus
    MS-Off Ver
    2010
    Posts
    50

    if is number or 0

    hi to everyone,i need a formula at B:B which follows A:A and if at A=any number write at B=2 or if A=0 to writeat B=1.thanks
    Attached Files Attached Files

  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,745

    Re: if is number or 0

    In B1 copied down:

    =IF(A1>0,2,1)

    You may need this version for your locale:

    =IF(A1>0;2;1)
    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
    Registered User
    Join Date
    03-29-2020
    Location
    cyprus
    MS-Off Ver
    2010
    Posts
    50

    Re: if is number or 0

    thanks ,but at A10 it shows 1,i want when A is empty B to be empty

  4. #4
    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,745

    Re: if is number or 0

    You didn't say that, though, did you?

    Try this:

    =IF(A1="","",IF(A1>0,2,1))

    For your locale:

    =IF(A1="";"";IF(A1>0;2;1))

    This is a basic nested IF formula.

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: if is number or 0

    then just add this to Ali's formula... =IF(A1="","",IF(A1>0,2,1))
    or her other formula =IF(A1="";"";IF(A1>0;2;1))

    wasn't sure if Ali was working another post so thought I'd help out, not needed. LOL.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  6. #6
    Registered User
    Join Date
    03-29-2020
    Location
    cyprus
    MS-Off Ver
    2010
    Posts
    50

    Re: if is number or 0

    thanks ,excelent

  7. #7
    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,745

    Re: if is number or 0

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  8. #8
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: if is number or 0

    B2=IF(ISBLANK(A1),"",IF(OR(SIGN(A1)=1,SIGN(A1)=-1),2,1))

    Copy down

+ 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. Replies: 5
    Last Post: 02-25-2020, 09:00 AM
  2. Converting number to actual text of number (spelling out the number)
    By rfigueroa1976 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-18-2019, 11:05 AM
  3. [SOLVED] Macros to mark number in a column, if number is x+10, given previously marked number x.
    By aleem5 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2015, 07:49 PM
  4. Replies: 10
    Last Post: 10-30-2013, 07:29 PM
  5. number in cell is number to add number of rows wit copy some contex
    By nicollab in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2012, 08:09 AM
  6. Lookup largest number in a column treating negative number as postive number
    By xWiZardx in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2010, 08:09 AM
  7. Replies: 7
    Last Post: 12-18-2008, 07:34 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