If Then with Multiple Ifs
I have two columns that I need to check if "true" before returning the text in the 3rd column. I am trying to create a formula that returns the Awarded Contractor's name in each City, i.e. Contractor Y for Boise and Contractor A for Chicago. I have tried a number of different IF, IFS, IF(AND) statements and can't figure it out. Any help would be appreciated.
Answers
-
If I understand what two columns you're validating, try this:
=IF(AND(NOT(ISBLANK(City@row)), Awarded@row = 1), Contractor@row)
-
Thanks for replying. I think I may have left something out. I will have a column that has Boise on one row and Chicago on another and I want a formula next to each city that returns the awarded contractor for each respective city.
-
It sounds like you need something more like this:
=IFERROR(INDEX(COLLECT(Contractor:Contractor, City:City, [City for Contractor]@row, Awarded:Awarded, 1), 1), "")
What I don't know is the column you are referencing that has city you are matching if it is different than your City column. So I've put as "city for contractor". You would need to update that in the formula.
-
Nic, Thank you so much for following up. This almost worked. However, it only returns the first contractor listed with the matching City and does not take into account the Awarded checkbox. I tried changing the order to look at Awarded first and then City but that returned an Unparseable error.
-
Hello @Ed B. try this =INDEX(COLLECT(Contractor:Contractor, City:City, City@row, Awarded:Awarded, 1), 1)Lol, that's the same as Nic's...
-
Eric, your formula actually worked. It was different from Nic's in that it did not include the IFFERROR command. I made that change and it worked beautifully. Thank you so much to you and Nic for getting me there. I appreciate it.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.2K Get Help
- 445 Global Discussions
- 143 Industry Talk
- 476 Announcements
- 5K Ideas & Feature Requests
- 84 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 488 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!