• Status: Solved
• Priority: Medium
• Security: Public
• Views: 71

# nested if

=If(Y1160=AB1160,Y1160),If(Y1160=AB1160,Y1160),AE1160

please help me out i need value a nested if

this have an error
0
Ernesto
• 5
• 4
• 2
2 Solutions

Commented:
Both your conditions are the same, so you don't need a nested IF. This looks like it will suffice...

=IF(Y1160=AB1160, Y1160, AE1160)
0

Author Commented:
not the same
compare 3 diferent values
0

Commented:
You'll need to describe what you want the formula to do then. What 3 values are to be compared? Your proto-formula is checking if Y1160=AB1160 twice.
0

Author Commented:
ok

bajas    bajas   bajas  bajas      result          bajas

bajas altas   bajas  bajas      result            false

altas altas altas  altas       result    altas

altas bajas altas altas     result    false

Regards!!!
0

Director of Information TechnologyCommented:
@EDO
Your if statement is not correctly structured

Nested IF should be soothing like this:

``````=If(A1=<something>,If(B2=<something> else,"Both are true","A1 is true, but B2 is false"),"A1 is false so B2 has to be false)
``````
0

Commented:
So comparing 4 values, not 3? And if all values are the same, return that value, otherwise return FALSE? You don't need a nested IF formula then. Use COUNTIF to check that all 4 are the same...

=IF(COUNTIF(A2:D2,A2)=4, A2)

See the attached workbook for an example.
COUNTIF.xlsx
0

Director of Information TechnologyCommented:
Try this
``````=IF(AND(A12=B12,B12=C12,C12=D12),A12,FALSE)
``````
0

Author Commented:
wayne,
thats the idea but there are not consecutive values
how to achive
regards
0

Commented:
In that case you will be best using edo60's method.
0

Author Commented:
im gona copy them together
0

Author Commented:
Tsm you experts!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

## Featured Post

• 5
• 4
• 2
Tackle projects and never again get stuck behind a technical roadblock.