Joined
·
1 Posts
Office 2010:
Need to create a function with multiple possible variables to create a sum total for a row.
Example:
If Cell B2 contains text "dragon" add 40 to sum, if Cell B2 contains text "tiger" add 60 to sum, if Cell B2 contains text "Adult" add 75 to sum. How to write this as a function?
I know that =IF(B2="dragon",40) will get the function to add 40 if "dragon" is entered in that cell, and do nothing otherwise, and I know that =IF(B2="dragon",40,60) will get the function to add 40 if "dragon" is entered in that cell, and add 60 otherwise, but I can't figure out how to program that third variable. Ideally, it would be able to put the correct amount in based on which of the three text options is entered into the cell.
Help?
Need to create a function with multiple possible variables to create a sum total for a row.
Example:
If Cell B2 contains text "dragon" add 40 to sum, if Cell B2 contains text "tiger" add 60 to sum, if Cell B2 contains text "Adult" add 75 to sum. How to write this as a function?
I know that =IF(B2="dragon",40) will get the function to add 40 if "dragon" is entered in that cell, and do nothing otherwise, and I know that =IF(B2="dragon",40,60) will get the function to add 40 if "dragon" is entered in that cell, and add 60 otherwise, but I can't figure out how to program that third variable. Ideally, it would be able to put the correct amount in based on which of the three text options is entered into the cell.
Help?