Automatically add line to formula

gaudrco

Board Regular
Joined
Aug 16, 2019
Messages
203
I don't know if this is possible but here it is:

I have a sheet that I use to display an overview of competitors. The information on the sheet shows one competitor at a time based off of a data validation dropdown list of values. When the dropdown list is changed, the cells on the sheet change to reflect the chosen competitors information. The cells with the competitor information are IF statements. The IF statements for each cell with information say =IF($P$3="Competitor_1",'Competitor Overview Data'!E4,IF($P$3="Competitor_2",'Competitor Overview Data'!F4,IF($P$3="Competitor_3",'Competitor Overview Data'!G4))). (The formula reference cell systematically moves to the right)

So, I have another function in my spreadsheet that adds new competitors. When a new competitor is added, it appears in dropdown list but obviously when I choose the newly added competitor, all the competitor information cells return FALSE because the new competitor is not included in the IF statements.

Is there a way that automate this process so that when I add a new competitor, the formulas include the new competitor IF statement with its corresponding reference cell?

Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Assuming that you have competitor names in 'Competitor Overview Data'!E1:G1 for the examples given, try

=IFERROR(INDEX('Competitor Overview Data'!$4:$4,MATCH($P$3,'Competitor Overview Data'!$1:$1,0)),"No Match")
 
Upvote 0
Another thought:

=OFFSET('Competitor Overview Data'!D4,0,MID(P3,FIND("_",P3)+1,3))

(this would allow for 999 competitors)
 
Last edited:
Upvote 0
jasonb75

Your formula simplified mine exponential:)

However, I cannot get it to work for my other cells. (or maybe I just don't understand the formula well enough to translate it.)

For the competitor name, that worked but I have these dynamic cells too
Description
Highlights
Company

I have more as well but if I can see how to make it work for these then I should be able to replicate it. All of my reference data is in a table with the Competitor name as the headers. Then the rows are Description, Highlights, Company in that order. How to I adjust the formula to go to these cells that hold the data

Thanks
 
Upvote 0
kweaver

This sounds great but I can't get it to work right. Is there a part of that formula that I need to adjust for my situation?
 
Last edited:
Upvote 0
Nevermind jasonb75 I figured it out! This is so much better! I thought it was impossible :)
 
Upvote 0
There isn't anything you need to adjust.


Excel 2010
P
2
3Competitor_4
4
5For 4
Sheet7
Cell Formulas
RangeFormula
P5=OFFSET('Competitor Overview Data'!D4,0,MID(P3,FIND("_",P3)+1,3))
 
Upvote 0
There isn't anything you need to adjust.
That is assuming that it does actually say "Competitor_1", etc rather than "Competitor_#" being a substitute for the actual competitor name.
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top