You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

VLOOKUP/INDEX Help for Conditional Cell Equality

I am not sure if this is even possible, but I am trying to make one cell equal another cell (where the number is entered manually) IF the dropdown selected in that same row is "selection"



I want the cell that is currently in error to equal the odometer reading that is manually entered by me IF the service selected in the first column is "Oil Change".


[Re-Titled by Moderator]

MacBook Air (M2, 2022)

Posted on Nov 14, 2024 3:59 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 14, 2024 5:30 PM

Assuming the top left cell in your screenshot is A1, the number entered manually is in cell G5, and the popup is in cell B5, The formula in B1 is

=IF(B5="oil change", G5, "the result if not oil change")


Replace "the result if not oil change" with what the result should be if B5 is not "oil change"

4 replies
Question marked as Top-ranking reply

Nov 14, 2024 5:30 PM in response to robertcc123

Assuming the top left cell in your screenshot is A1, the number entered manually is in cell G5, and the popup is in cell B5, The formula in B1 is

=IF(B5="oil change", G5, "the result if not oil change")


Replace "the result if not oil change" with what the result should be if B5 is not "oil change"

Nov 15, 2024 5:36 PM in response to robertcc123

Yes. This question does require doing a lookup.

=XLOOKUP("Oil Change",B5:B11,G5:G11,"not found",match-type,−1)

You will have to edit the formula when you add new rows to the table, unless you add them above the bottom row.


The Numbers way to do this better would be to have all of the data from row 4 on down in its own table. Say that table is named "Service Data" and that row 1 of that table is a header row. The formula would be

=XLOOKUP("Oil Change",Service Data::B,Service Data::G,"not found",match-type,−1)

You won't have to edit the formula when adding new rows.

VLOOKUP/INDEX Help for Conditional Cell Equality

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.