+ Reply to Thread
Results 1 to 24 of 24

If formula with mark "-" combination

  1. #1
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    If formula with mark "-" combination

    hi all,

    i am looking for some formula to figure out this problem;

    --data1-------expected result---------data2-----
    john---------------mark "-" ----------- mark "-"
    mark "-" -----------ok------------------mark "-"
    mark "-"------------ok-----------------sisca43

    with using if formula, how to make it in column expected result (col. B)

    assuming mark"-" as -

    thanks...

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,958

    Re: If formula with mark "-" combination

    It depends. Is the - a custom format for zero values, or is it a string value? Assuming Data1 is in A and Data2 is in C, try

    Zeroes version:
    =IF(A2=C2,"ok",IF(A2=0,"ok",0))

    String version:
    =IF(A2=C2,"ok",IF(A2="-","ok","-"))
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    Bernie, thanks but with new criteria, how about this ;

    data1-----------expected result------data2
    john-------------ok----------------- mark "-" (new criteria)
    john---------------mark "-" ----------- mark "-"
    mark "-" -----------ok------------------mark "-"
    mark "-"------------ok-----------------sisca43

  4. #4
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    here. workbook attached

    please, see it..
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    sorry have a correction, here new file update
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    bump-bump!!!!

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: If formula with mark "-" combination

    Hi John,

    Could you please explain the logic (if any) behind the desired results?
    Why Mike is "OK" and David "-"?
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If formula with mark "-" combination

    Agree with AlKey, there doesn't appear to be any sensible logic to why mike and john are ok, but david is -
    Also there are 2 other cells in column A that are already -, and they are ok.

    The only pattern I see that is common with the ok's that doesn't exist with the -
    Is they are less than 5 characters in length.

    So this will produce your desired results in B2 and filled down to B6
    =IF(LEN(A2)<5,"ok","-")
    Last edited by Jonmo1; 04-15-2014 at 09:51 AM.

  9. #9
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: If formula with mark "-" combination

    @Jonmo1

    I like it! I guess, when there is an absence of logic, one should invent one

  10. #10
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    ok guys,

    here 3 criteria not logic characters in length ;
    1) if col. a contains value/text and col. c mark "-" so result (in col. b) returning "-"
    2) if col. a contains "-" and col. c contains "-", returning "ok" in col.b
    3) if col. a contains "-" and col. c contains text/value, returning "ok" in col.b

  11. #11
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If formula with mark "-" combination

    But Your example book doesn't follow that pattern.

    You have ok in B2, but A2 has text and C2 has -

  12. #12
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    hi, Jonmo, i am sorry..

    but here in file attached..
    Attached Files Attached Files

  13. #13
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If formula with mark "-" combination

    That new book 'still' doesn't follow the pattern of rules you posted.

  14. #14
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    maybe...
    1) if col. a contains value/text and col. c mark "-" so result (in col. b) returning "-"
    2) if col. a contains "-" and col. c contains "-", returning "ok" in col.b
    3) if col. a contains "-" and col. c contains "text, returning "ok" in col.b

  15. #15
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If formula with mark "-" combination

    Maybe...

    =IF(A2="-","ok","-")

    Note, this produces the results you describe in your posts, not the results shown in the books you've posted.

    Also, there's a 4th possiblity,
    If BOTH A and C contain a text value..

  16. #16
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    hi Jonmo, for 3 rd criteria your formula not work, the result should be "-" not "ok"

  17. #17
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: If formula with mark "-" combination

    For your last example try this one

    =IF(OR(LEN(A3)>1,LEN(C3)>1),"-","Ok")

  18. #18
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If formula with mark "-" combination

    As I said, the formula I suggested follows the rules you posted in the thread, not what you posted in the books.
    Quote Originally Posted by Jhon Mustofa View Post
    maybe...
    1) if col. a contains value/text and col. c mark "-" so result (in col. b) returning "-"
    2) if col. a contains "-" and col. c contains "-", returning "ok" in col.b
    3) if col. a contains "-" and col. c contains "text, returning "ok" in col.b

    Let's do this.

    Please replace the ??'s below with the results you want for the described situation.

    ColA = - and ColC = - : I want ??
    ColA = - and ColC = text : I want ??
    ColA = text and Col C = - : I want ??
    ColA = text and Col C = text : I want ??
    Last edited by Jonmo1; 04-15-2014 at 11:59 AM.

  19. #19
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    ColA = - and Col.c = - : col. b -
    ColA = - and Col.c = text : col.b -
    ColA = text and Col c = - : col. b -
    ColA = text and Col c = text : col.b -

  20. #20
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If formula with mark "-" combination

    Sorry, I used wrong column refs in my previous post.
    Please refresh browser and look at it again.
    Last edited by Jonmo1; 04-15-2014 at 12:00 PM.

  21. #21
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    hi Alkey, for 2 rd (OP #19) : for Col a = - and Col.c = text : col.b should be "-" not "ok"

  22. #22
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If formula with mark "-" combination

    OK, given your latest description of your desired results in post #19

    It looks like the formula in column B should be
    ="-"
    Last edited by Jonmo1; 04-15-2014 at 01:46 PM.

  23. #23
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    hi jonmo1, if Col a2 = text and Col c2 = - : in col. b2, return "-"

  24. #24
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: If formula with mark "-" combination

    hi alkey, i missing it..

    your code :

    Please Login or Register  to view this content.
    that worked!!! many thanks...

+ 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. [SOLVED] Counting data only contains text (ignore mark "-" & "")
    By Jhon Mustofa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-12-2014, 09:45 PM
  2. [SOLVED] Countif Formula to mark with "1"
    By elgato74 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-05-2014, 09:57 AM
  3. Replies: 3
    Last Post: 08-28-2012, 10:49 AM
  4. Replies: 2
    Last Post: 05-17-2012, 03:12 AM
  5. Replies: 6
    Last Post: 01-08-2006, 06:20 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