Home > Enterprise >  IF Function in Microsoft EXCEL not executing well
IF Function in Microsoft EXCEL not executing well

Time:11-29

I have the following spreadsheet in EXCEL (in French) where I'm using the IF function to fill the cell I8 with the following:

  • IF the cell I7 is blank then fill it with blank ""
  • IF the cell I7 is not blank and the cell I10 has the side "SHORT" then calculate I6-I7
  • IF the cell I7 is not blank and the cell I10 has the side "LONG" then calculate I7-I6

enter image description here

The goal is to calculate how much points between our entry and exit prices while respecting the side of the trade. I attached an image of the sheet.

I tired this formula (Si is same as IF) but it didn't work: =SI(ESTVIDE(I7),"",SI(I10="Long",I7-I6,SI(I10="Short",I6-I7,"")))

CodePudding user response:

  • Based on the image, the cell filled in short/long you actually check is H10 rather then I10, since the mergered cells only keep data shown on the top left. Accordingly, change your original function I10="short/long" to H10="short/long"

-If it is not mergered cells, you function is going to work.

  • Related