How to include 2 separate IF and ISBLANK functions in 1 cell?

Is this possible? I’ve searched online and tried shifting things around, but all methods have failed.
I want the function to follow the following steps:

  1. If I30 is “A” use J30
    • but if J30 is blank, leave field blank
  2. If I30 is not “A”, use K30
    • but if K30 is blank, leave field blank

Below are my attempts:

=IF(AND(I30="A",IF(AND(ISBLANK(J30),"",J30)),K30))
=IF(AND(I30 = "A",(ISBLANK(J30),"",J30),IF(AND(ISBLANK(K30),"",K30))))
=IF(AND(I30<>"A",(ISBLANK(J30),"",K30)))
=IF(AND(I30<>"A",(ISBLANK(J30),"",K30~J30)))
=IF(I30<>"A",1,3)

The 2nd to last function always changes the “,J30” at the end to “~J30”, btw.

To be clear, this function for ISBLANK works just fine:

=IF(ISBLANK(J30),"",J30)

Edit: Corrected the ISBLANK function.

=ISBLANK(J30),"",J30

is incorrect and yields probably Err:509


Check `=IFS(I30="A";IF(ISBLANK(J30);"";J30);I30<>"A";IF(ISBLANK(K30);"";K30))`

:frowning: I meant:

=IF(ISBLANK(J30),"",J30)

Yours worked, btw.

Edit: Finally got it.

for such a simple task … why so complicated?

just try

=IF(I30="A";IF(J30<>"";J30;"");IF(K30<>"";K30;""))

or am i wrong?

kiss - keep it simple and stupid

P.S. solved marks and likes ‘^’ welcome …

[edit]
another try with IFS:

=IFS(AND(I30="A"; J30<>"");J30; AND(I30<>"A"; K30<>"");K30; 1;"")

[/edit]

Best answer 1+