logo
search
Formula Errors

How to Use Excel IF Formula to Choose a Value from Two Columns

Bushra ParveenBushra Parveen Sep 30, 2026 869 views

Question details

The user needs to return a value from either column J or column G based on whether the corresponding cell in column K contains "Yes" or "No".

How to Use Excel IF Formula to Choose a Value from Two Columns
Product
Excel
Device & OS
not provided
Scenario
Attempting to conditionally extract data from alternating columns based on a text condition in a third column.
Observed behavior
Using the SUMIFS formula produces an argument error because it is overly complicated and not designed to toggle between two distinct return columns row-by-row.
Before you start

Identify the columns containing your target values and the column containing your text condition before writing the formula. Ensure your conditional text (such as 'Yes' or 'No') exactly matches the data in your spreadsheet without extra trailing spaces.

Solution 1Recommended

Use a Standard IF Formula for Row-by-Row Selection

This is the most straightforward method to return a value from one of two columns based on a specific text condition in the same row.

The IF function evaluates a logical test and returns one value if true, and another if false. It is much better suited for this task than SUMIFS, which requires ranges of matching sizes and is designed for conditional summing rather than selective data extraction.

1
Select the target cell

Click on the cell where you want the conditional result to appear (for example, cell L3).

2
Input the IF formula

Type the formula =IF(K3="Yes", J3, G3) into the formula bar. This checks if the value in K3 is exactly "Yes". If it is, the formula outputs the value from J3; otherwise, it defaults to the value in G3.

3
Apply to the column

Press Enter to apply the formula. Then, click the bottom-right corner of the cell (the fill handle) and drag it down to copy the formula to the remaining rows in your dataset.

Use a Standard IF Formula for Row-by-Row Selection
Keep it Simple: It is common to overcomplicate formulas when trying to extract data. A simple IF statement handles two-column alternatives perfectly without triggering argument errors.

Master Complex Formulas Easily with WPS Spreadsheet

WPS Spreadsheet provides robust, error-free support for all logical functions including IF, IFS, and SUMIFS. Its intuitive interface and built-in formula wizard make resolving argument errors and managing complex conditional data incredibly simple.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your conditional data.
  2. 2. Use the Function Wizard: Click the 'fx' button next to the formula bar to open the function wizard. Search for 'IF' and select it.
  3. 3. Fill in the arguments: Use the guided dialog boxes to input K3="Yes" for the Logical test, J3 for Value_if_true, and G3 for Value_if_false, then click OK to instantly apply it without syntax errors.
Fully compatible with Microsoft Excel formulas, functions, and .xlsx file formats.Built-in function wizard helps you troubleshoot argument errors by guiding your inputs.Lightweight software with fast calculation performance for large datasets.
microsoft office alternative - wps office

Frequently Asked Questions

Why does SUMIFS give an argument error in this scenario?

SUMIFS is designed to sum a single continuous range based on specific criteria. It cannot toggle between two different sum columns row-by-row based on a condition. An IF statement is the correct function for choosing between distinct columns.

Can I use multiple conditions to choose which column to pull from?

Yes, you can use the IFS function or nest multiple IF functions. For example, =IF(K3="Yes", J3, IF(K3="Maybe", H3, G3)) evaluates multiple scenarios and returns the corresponding column's value.

What if my condition column has more values than just 'Yes' and 'No'?

The formula =IF(K3="Yes", J3, G3) assumes anything that is not 'Yes' will default to the G column. If K3 might contain blanks or other words and you strictly want G3 only when the cell says 'No', you should use a nested formula: =IF(K3="Yes", J3, IF(K3="No", G3, "")).