# Need help with formula

Copper Contributor

# Need help with formula

So I need a hand with sorting this out.

Cell B58 and D58 are drop down menus and I have part pf the list at the bottom. I want to be about to select say "Belyando" and "Brisbane" in the lists and then cell f58 will show the correct number.

I was advised to use the If(AND( but it doesn't want to work for me. Any help is appreciated

8 Replies

# Re: Need help with formula

@Adrien89 Double-check your formula syntax. The screenshot doesn't show the entire formula, but from what is visible, I can see that the first use of the AND function is missing the closing bracket and comma between "Gatton" and 1940. It should be =IF(AND(B58="Adelaide",D58="Gatton"),1940,…)

# Re: Need help with formula

This is my current full formula. But it's not completed yet as there is 78 options in total that I need to put in

# Re: Need help with formula

@Adrien89 Just to confirm, what spreadsheet program are you using? You've tagged Office 365, but the screenshot doesn't look like Excel. Is it Google Sheets? Or something else?

# Re: Need help with formula

This screenshots is in excel. I did that on my tablet but was doing the actual spreadsheet on my phone in 365

# Re: Need help with formula

@Adrien89 A simpler approach would be to list all of the possible departure and destination locations in a lookup table, like you have started in cell B74, then use the XLOOKUP function, if it's available in your program. For example:

``=XLOOKUP(1, (B58=\$B\$75:\$B\$1000)*(D58=\$C\$75:\$C\$1000), \$D\$75:\$D\$1000, 0)``

# Re: Need help with formula

if possible,share your Excel .xlsx file.

# Re: Need help with formula

I'll have to have a look at this a little later tonight as I'm not the tech savvy LOL