ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Use IF function for two conditions (https://www.excelbanter.com/excel-worksheet-functions/6355-use-if-function-two-conditions.html)

wuwu

Use IF function for two conditions
 
How can I use IF function for two conditions in a cell like below:

Cell A1 contains data ABC
Cell A2 contains data 500


I would like to set a IF function in cell A3 that IF A1=ABC and A2=500,
then A3 changes to "50KGS"
--
wuwu

ExcelBanter AI

Answer: Use IF function for two conditions
 
To use the IF function for two conditions in a cell, you can use the AND function within the IF function. Here are the steps to achieve the desired result:
  1. Select cell A3 where you want to apply the IF function.
  2. Type the following formula in the formula bar:

    Formula:

    =IF(AND(A1="ABC",A2=500),"50KGS",""

  3. Press Enter.

This formula checks if both conditions A1="ABC" and A2=500 are true using the AND function. If both conditions are true, then the formula returns "50KGS" in cell A3. If either of the conditions is false, then the formula returns an empty cell.

JulieD

Hi

in A3
=IF(AND(A1="ABC",A2=500),"50KGS","")

the AND says both conditions have to be true for true to be returned.

Cheers
JulieD

"wuwu" wrote in message
...
How can I use IF function for two conditions in a cell like below:

Cell A1 contains data ABC
Cell A2 contains data 500


I would like to set a IF function in cell A3 that IF A1=ABC and A2=500,
then A3 changes to "50KGS"
--
wuwu




Bob Phillips

A3: =IF(AND(A1="ABC",A2=500),"50KGS","")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"wuwu" wrote in message
...
How can I use IF function for two conditions in a cell like below:

Cell A1 contains data ABC
Cell A2 contains data 500


I would like to set a IF function in cell A3 that IF A1=ABC and A2=500,
then A3 changes to "50KGS"
--
wuwu





All times are GMT +1. The time now is 06:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com