In Excel, after judging that the two conditions are met, return the values that meet the two conditions?

Reported answer
In Excel, after judging that the two conditions are met, return the values that meet the two conditions?
Ask online customer service
Scan the code to ask online customer service

In EXCEL, how to determine that the two conditions are met, and then return the values that meet the two conditions?

  • Number of answers

    five

  • Number of browses

    6,228

5 answers Default sorting
  • Default sorting
  • Sort by time

Adopted
In Excel, you can use the IF function to judge multiple conditions and return corresponding values. Specifically, you can use the AND function to meet multiple conditions at the same time, and then use the IF function to return different values according to the results.
Here is an example formula:
=IF (AND (condition 1, condition 2), the value you want to return, "")
In this example, "the value you want to return" refers to the specific value that needs to be returned after judging according to multiple conditions. For example, entering "50" in "Value you want to return" means returning 50 if all conditions are met.
When multiple conditions are met at the same time, the AND function can be used. For the two conditions shown in the example, you can set them as follows:
1. Enter "=AND (Condition 1, Condition 2)" in a cell, where "Condition 1" and "Condition 2" respectively represent the specific content to be met at the same time.
2. Click the cell with the mouse and select "Review - Team tab - Constraints - Equivalent to the following conditions..." in the pop-up menu.
After this setting, a check box will appear next to the cell, and you can check other conditions that need to be met.
Finally, use "=IF (AND (Condition 1, Condition 2), the value you want to return," ")" in other cells to set the results. Please replace the "value you want to return" with the specific value that needs to be returned based on multiple conditions.
In this way, you can return specific values after judging according to multiple conditions. I hope it is helpful to you.
cancel comment

If the figure above is sheet1, the figure below is sheet2

First, add an auxiliary column in sheet 1, as shown in the figure

Enter the formula in d2:

=if(a2="",d1,a2)

Drop down and hide column d after getting data

Then enter the formula in b2 of sheet 2:

=sumproduct((sheet1!$d$2:$d$100=$a2)*(sheet1!$b$2:$b$100=b$1)*(sheet1!$c$2:$c$100)

Pull down right and down, and the results are as follows:

cancel comment
An auxiliary column E needs to be added, E1=A1&B1,...,E4=A4&B4, be
D1=INDEX (C1: C4, MATCH (Beijing cabbage, E1: E4,0))
cancel comment

=INDEX(C:C,MAX(SMALL(IF($A$3:$A$12=F12,ROW($A$3:$A$12),65536),1),SMALL(IF($B$3:$B$12=G12,ROW($A$3:$A$12),65536),1)))
Array formula. You need to press CTRL SHIFT at the same time
cancel comment
=INDEX(D1:D3,SMALL(IF((A1:A3=F1)*(B1:B3=G1),ROW(D1:D3),4^8),1),1)

Array function Ctrl+shift+enter
cancel comment
ZOL Q&A > In Excel, after judging that the two conditions are met, return the values that meet the two conditions?

report

Thank you for contributing to the harmony of the community. Please select the type of report

Reported successfully

It will be handled after verification
Thank you for your contribution to community harmony

Scan the code to participate in the trial of new products at 0 yuan
You can get the sheets and grand gifts on the top floor

 Scan and pay attention to us
Tips

Are you sure you want to cancel this registration and exit this activity?