SOLVED

Need help with IF

New Contributor

Hi,

 

I have an If sentences here: 

=IF(AND($B2=$B3;$F2="4410";$G3<>"0000-00");$G3;IF(AND($B3=$B4;$F2=4410;$G4<>"0000-00");$G4;IF(AND($B5=$B6;$F2=4410;$G5<>"0000-00");$G6;".")))

 

* I want to print out the cost value below the "0000-00".  If the logical are correctly. My sentence works fine, until the cost column has two "0000-00" under eachother (see 2. picture).

 

* Someone who can help?

 

 

htrankevin_2-1663053264323.png

 

2. picture:

htrankevin_3-1663053383681.png

 

 

 

 

3 Replies
best response confirmed by htrankevin (New Contributor)
Solution

@htrankevin 

Hi Kevin, in your IF() question you refer once to a text "4410" and once to a number 4410. I don't know if this solves the problem yet, because I couldn't understand what you want to achieve at all. Perhaps you could describe the desired goal a little better.

 

=IF(
  AND($B2=$B3,$F2="4410",$G3<>"0000-00"),
    $G3,
    IF(
      AND($B3=$B4,$F2=4410,$G4<>"0000-00"),
        $G4,
        IF(
          AND($B5=$B6,$F2=4410,$G5<>"0000-00"),
            $G6,
            "."
        )
    )
  )

Shouldn't lines 8 and 9 read as follows?

AND($B4=$B5,F2=4410,$G5<>"0000-00"),$G5

 

 

@htrankevin 

It also looks like the first table has a hidden E column but it does not look like the second table does.  Are these the same table or is the second image a different table?  Is it really F & G or are the last two columns E & F?

(sorry I should have noted here that I put the lines 296 & 297 on line9 and 10 of my sample)

Also Keep in mind that lines 296 and 297 ALL Column are the same. So if you are testing B9=B10 (True), F9=4410 (True), G9<>(not equal to) "0000-00" (False) So you should get the . if your formula was correct everywhere else. The same is true for B10 because both B10=B11 and G10<>"0000-00" are false.

 

Hope this helps.

Cat

Hi, thanks for replying.

My goal is to print out the cost value under the row that contains "4410", if the bunt in column 1 and 2 is eaqual to eachother.

Your file printed out the correct one



For example: