Forum Discussion
DennisMetro
Jun 24, 2021Copper Contributor
EXCEL IF FUNCTION
Hi,
So, for example, =IF((H2="")*(J2=""),"",IF(H2>J2,"overload","apples"))
this basically says if H2 or J2 are empty then return an empty string but if H2 is greater than J2 then return "overload" otherwise "apples". Fine - ok.
Now, if the values "overload" and "apples" are unknown when I write this code how do I get the output to give me "whatever the value of this string is"? Thanks for any help. Dennis
Enter the values you want to return in cells, e.g in Y1 and Z1. You can then use
=IF(H2&J2="","",IF(H2>J2,$Y$1,$Z$1))
7 Replies
Sort By
- dost7189Copper ContributorExcel IF function is used to evaluate one or more criteria to determine what value should be returned.
If the number entered into the first argument meets the criteria (first and second arguments) specified in the third, fourth, and fifth arguments of that function then it will return a "true" value, otherwise it will return "false". Here are some examples for you:
=IF(A2="", "N/A", A2+B3) -Returns a formula if item from cell A2 does not equal something else.= = =IF(RAND()>"0.05","No Conditional Result Found Yet","Conditional Statement") -This would look at how many times
For a comprehensive resource about excel IF statement you can read here in detail
https://www.exceltrick.com/formulas_macros/excel-if-statement/ Enter the values you want to return in cells, e.g in Y1 and Z1. You can then use
=IF(H2&J2="","",IF(H2>J2,$Y$1,$Z$1))
- DennisMetroCopper ContributorHi Hans, Thanks. The problem is I don't know the values of Y1 and Z1. There is a range of possible values. When I know the values for Y1 and Z1 I could just put them directly into the "______" part of the code. Hence my "whatever the value of this string is".
I don;t understand. What do you mean by "whatever the value of this string is"? What is "this string"?