Numbers conditional formatting help

I have two sheets on the same numbers table.... im trying to do some conditional formatting but having difficulty


sheet one has two columns that need to read and fill from two columns on the other sheet... let me explain....


sheet one has column B for customer names that I will fill on an as needed basis. Column D needs to fill in a set number based on the name populated into column B


sheet two has column A with has all the potential names that I could put in columns B of sheet one and sheet two has column B which has a number that corresponds to the name next to it in column A


so if I put in Jill in B1 on sheet one, I need not to see jills name somewhere in column A on sheet two and fill in cell D1on sheet one with the number from column B in the cell next to jills name on sheet two...


Does this make sense at all? lol please help

Posted on Jan 18, 2022 6:26 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 18, 2022 8:22 PM

From your description it sounds as if you are trying to do a lookup. You could try something like this:




The formula in D2, filled or copied down, is:


=XLOOKUP(B2,Table 2::A,Table 2::B,"not found")


Or, if your region uses , as a decimal separator:


=XLOOKUP(B2,Table 2::A;Table 2::B;"not found")


SG


6 replies
Question marked as Top-ranking reply

Jan 18, 2022 8:22 PM in response to James.kerski

From your description it sounds as if you are trying to do a lookup. You could try something like this:




The formula in D2, filled or copied down, is:


=XLOOKUP(B2,Table 2::A,Table 2::B,"not found")


Or, if your region uses , as a decimal separator:


=XLOOKUP(B2,Table 2::A;Table 2::B;"not found")


SG


Jan 21, 2022 4:06 PM in response to James.kerski

HI James,

'if I want the lookup formula to search column A of Table 2 and return the contents of Column B just as it has in your formula, but I also want it to Search column A of Table 3 and return the corresponding number from column B if the first lookup of Table 2 returned nothing'


(Initial section deleted, as it contained notes on a version of the formula below that wasn't working.


Working formula is displayed and discussed below.) B.



Here are screenshots of the lookup tables on Sheets 2 and 3.

Sheet 2:






Sheet 1:: Table 1:



The formula shown below the four search results is entered in the selected cell (B2), and filled right to D2, then filled down to the last row in the table.


In rows where there is no name entered in column A, the formula will match the first empty cell it finds, and return the data in columns B, C and D of the row in which that empty cell was found. If these cells are also empty, the formula will return zeros to the cells on this table.


Note that there is no text entered in the If not found token. This omission makes XLOOKUP throw an error message, which is caught by IFERROR. IFERROR then runs the second XLOOKUP function, which searches the same name in the lookup table on Sheet 3.


If this search also fails to find the name, XLOOKUP calls the I fnot found argument, and the 'not found" text there is returned to the cell containing the formula.


Regards,

Barry


PS: An alternate route to running an XLOOKUP search on more than one lookup table might be to use UNION RANGES to combine the search ranges and the return ranges from two or more tables into a single search field.



Jan 22, 2022 1:57 AM in response to James.kerski

James.kerski wrote:

what if I have a third sheet that also has a column of names and corresponding numbers in the next column


When things start getting complicated like this it can be helpful to consider whether there are ways to simplify the structure of document. For example, do you really need two separate tables, each with a column of names and and a column of corresponding numbers?


It is often much more efficient to keep "like" data (data in similar form) all together in the the same table.


Maybe one table had a names and numbers for month 1, and the other table had similar data for month 2. Then put all the dat in one table and add a column for month.


It may seem repetitive to list month 1 month 1 month 1 month 2 month 2 month 1, etc. down the third column. But doing it that way, rather than having separate tables, will make it much easier to look up, extract, or summarize information.


SG

Jan 21, 2022 11:43 AM in response to SGIII

can this be expanded on to search two columns?


so for context the look formula is perfect but what if I have a third sheet that also has a column of names and corresponding numbers in the next column


if I want the lookup formula to search column A of sheet 2 and return the contents of Column B just as it has in your formula, but I also want it to Search common A of sheet 3 and return the corresponding number form column B if the first lookup of sheet 2 returned nothing

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Numbers conditional formatting help

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