Forum Discussion

Donna830's avatar
Donna830
Copper Contributor
Aug 20, 2023
Solved

Excel - How to automate a cell so it contains one of two formulas, depending on the situation

I'm an Excel neophyte and would appreciate any guidance the community can provide!

I need the formula in each cell of Column D to be situational. (Screenshot below of selected columns) 

  • In one situation (e.g., D58), the formula would be =F58+E58
  • In the other situation (e.g., D59), the formula would be =ABS(F59+G59)

I tried =IF(A60=Y, A60=ABS(F60+G60),A60=E60+F60) - thinking I could use a "Y" value in column A to signal which formula would be used; however, I'm getting #NAME? 

 

Thanks!

 

  • Donna830 

    =IF(A60="Y", ABS(F60+G60),E60+F60)

     

    You can try this formula in cell D60. Y is text and has to be entered in "" within a formula.

2 Replies

  • Donna830 

    =IF(A60="Y", ABS(F60+G60),E60+F60)

     

    You can try this formula in cell D60. Y is text and has to be entered in "" within a formula.

    • Donna830's avatar
      Donna830
      Copper Contributor
      Quadruple Pawn, you've done it again! Thanks!!

Resources