1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  3. When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Merging of formula

Discussion in 'Ask an Excel Question' started by paradise, Jan 6, 2019.

  1. paradise

    paradise Member

    Messages:
    151
    Hi,
    I have two formula which I want to merge-

    1.=IF(C12="","",IF(C12=E12,"same",""))
    2.=IF(D12="","",IF(D12=F12,"same",""))

    The first formula says that if C12 & E12 are same i.e it must be numeric value then result will display "same",else space.Pls note that C12 & E12 might contains space i.e blank in both C12 & E12 in that case also it will display"same" becoz both are same,this blank should be ignored.Similarly No.2 formula also but different references.
  2. Hui

    Hui Excel Ninja Staff Member

    Messages:
    11,692
    =IF(or(D12=F12, C12=E12),"same","")
  3. paradise

    paradise Member

    Messages:
    151
    It didn't worked as expected.
  4. Hui

    Hui Excel Ninja Staff Member

    Messages:
    11,692
    Can you explain why it didn’t work with examples of shag values each cell had and the answer it should be?
  5. Peter Bartholomew

    Peter Bartholomew Well-Known Member

    Messages:
    584
    It is not really made clear what is meant by 'merging' the two conditions.
    Should both conditions hold or will either do? Are text strings valid or must the cells contain numbers? If numbers, are they integers, in which case equality tests are sufficient, or non-integers. The latter would require equality to within some tolerance to allow for rounding error.

    If the required condition is AND rather than OR
    = IF( AND( ISNUMBER(C12), ISNUMBER(E12), (C12=E12), (D12=F12) ), "same", "" )
    or a rather more algebraic form
    = IF( (C12<>"") * (E12<>"") * (C12=E12) * (D12=F12), "same", "" )
  6. paradise

    paradise Member

    Messages:
    151
    Sorry for delay reply.I have given example in simpler form.Pls find enclosed in attachment file.This will clear.Refer my last column results that I am expecting.

    Attached Files:

    Last edited: Jan 20, 2019 at 1:12 PM
  7. vletm

    vletm Excel Ninja

    Messages:
    4,645
    paradise
    This gives same as Your expected results...

    Attached Files:

  8. Hui

    Hui Excel Ninja Staff Member

    Messages:
    11,692
    My formula above works fine
    It is the cell addresses of your data that are different to what you asked of us above ?

    F2: Should be when adjusted: =IF(OR(C2=E2, B2=D2),"same","")
  9. bosco_yip

    bosco_yip Excel Ninja

    Messages:
    2,106
    Maybe,

    F2, copied down :

    =IF(N(B2)*N(D2)*(B2=D2)+N(C2)*N(E2)*(C2=E2),"same","")

    Regards
    Bosco

Share This Page