简体   繁体   中英

how to get data from another sheet in excel using IF function

I want to develop an IF function using the new RecommendedExchange Rate Type value.

From the DataInput worksheet I'll calculate the Cost Price (AU) (in the Cost Price (AU) column) using the following criteria:

If the Exchange Rate Type is NL then the Cost Price (AU) is calculated by multiplying the Cost Price (NL) by the Exchange Rate (NL to AU) cell on the DataInput worksheet

in order to reference a cell on another sheet, instead of using:

=A1

you need to include the sheet name in front of it. So if we want to reference A1 on another sheet we use:

='another sheet'!A1

So in order to build your IF statement, you would build it like another other if statement, you would just need to include the sheet name with the cell reference for those cells located on other worksheets.

As an example in order to pull the value from B3 on sheet3 when the value of the current sheet cell M42 is TTT, but to pull the valus from A1 on the BRAINS sheet it would look something like:

=IF(M42="TTT",'sheet3'!B3,'BRAINS'!A1)

The IF function is made up of three parts:

  • The logical check, conditional check, what ever you want to call it that resolves to either TRUE or FALSE
  • The TRUE result action
  • The FALSE result action

Each to the parts is separate by a comma and looks like this in the general sense:

IF(CONDITION CHECK, TRUE action, FALSE action)

Now if you do not put the FALSE action in, and the condition check returns false, then the result of your IF function will display FALSE.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM