How to write a formula that can use data from multiple sheets?

Visitor

I need a formula that goes something like this: If cell B2 on worksheet3 is "Name of worksheet1" then use cell K2 from worksheet1 to subtract cell J2 from worksheet3. But if cell B2 on worksheet3 is "Name of worksheet2" then use cell I2 from worksheet2 to subtract cell J2 from worksheet3

1 Reply

@Rashhour123 

=IF(B3="worksheet1",worksheet3!J2-worksheet1!K2,IF(B3="worksheet2",worksheet3!J2-worksheet2!I2,""))

You can try a nested IF formula.

worksheets.JPG