+ Reply to Thread
Results 1 to 14 of 14

IF Function

  1. #1
    Registered User
    Join Date
    08-25-2011
    Location
    Chesapeake, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    IF Function

    I am trying to create an IF function that will do the following:

    If A2 is equal to > 1 or contains a "P" enter the number 3 in A1, otherwise A1 is left blank

    Any assistance is appreciated
    Last edited by marktwark; 08-26-2011 at 11:19 AM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: IF Function

    Please Login or Register  to view this content.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,717

    Re: IF Function

    In cell A1 try:

    =if(or(A2>1,A2=1,A2="P"),3,"")

    I have assumed that you you meant A2=1 or A2>1 by your request.

    Alan
    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

  4. #4
    Registered User
    Join Date
    08-25-2011
    Location
    Chesapeake, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: IF Function

    Actually, if there is a date or the letter P in A2, I want A1 to display the number 3, otherwise A1 would be blank.

  5. #5
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: IF Function

    Dates in Excel are whole numbers between 1 and 2958465 (1/1/1901 and 12/31/9999). What's the earliest date you will accept as being valid?

  6. #6
    Registered User
    Join Date
    08-25-2011
    Location
    Chesapeake, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: IF Function

    I wish I would have stated the issue more carefully. I know how dates count but what I want more specifically is IF H113 is any date or contains the letter P then G113 will display a 3 (which will be counted in another formula) IF H113 contains the letter E or S then G113 will be a null value.

    I would really appreciate any input. Thanks...... Mark

  7. #7
    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: IF Function

    What would you like the output to be if neither of those criteria are met?

    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.

  8. #8
    Registered User
    Join Date
    08-25-2011
    Location
    Chesapeake, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: IF Function

    Quote Originally Posted by Domski View Post
    What would you like the output to be if neither of those criteria are met?

    Dom
    IF H113>1 or the letter P then display a 3 in G113, IF H113 contains an E or S, G113 equals a null value.

    Thanks for the heads up on forum rules. I have something due today and this is the final obstacle.

  9. #9
    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: IF Function

    Hi,

    I get that but what should be the outcome in G113 if the value in H113 matches neither of those criteria?

    Please also don't quote whole posts when replying.

    Dom

  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: IF Function

    Try this: =IF(OR(H113>1,H113="P"),3,IF(OR(H113="E",H113="S"),"","Neither criteria met"))

    Dom

  11. #11
    Registered User
    Join Date
    08-25-2011
    Location
    Chesapeake, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: IF Function

    The value in G113 should be nothing if there is an S or an E in H113. I appreciate your time...... Mark

  12. #12
    Registered User
    Join Date
    08-25-2011
    Location
    Chesapeake, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: IF Function

    This formula populates a 3 in G113. That's my biggest obstacle.

  13. #13
    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: IF Function

    =IF(OR(AND(ISNUMBER(H113),H113>1),H113="P"),3,IF(OR(H113="E",H113="S"),"","Neither criteria met"))

    Dom

  14. #14
    Registered User
    Join Date
    08-25-2011
    Location
    Chesapeake, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: IF Function

    That's it! Thank you very much. The project is done!

+ 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