Help with Concatenate

mobyzone

Board Regular
Joined
Apr 17, 2008
Messages
73
Hi all,

Should be a nice easy one for you experts, i'm trying to do more than 7 IF statements and I understand I need to use Concatenate to get this to work.. however its not working for some reason! Formula is as below

=CONCATENATE(IF(A2="Compaq 2510p",(TODAY()-$K$2)/365.25,IF(A2="Compaq 6730b",(TODAY()-$K$3)/365.25,IF(A2="Compaq 6910p",(TODAY()-$K$4)/365.25,IF(A2="Compaq 6930p",(TODAY()-$K$5)/365.25,IF(A2="Compaq dc7100",(TODAY()-$K$6)/365.25,IF(A2="Compaq dc7600",(TODAY()-$K$7)/365.25,IF(A2="Compaq dc7700",(TODAY()-$K$8/365.25)))))))))

The minute I add another IF statement it just errors. Any ideas?

Thanks so much!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try what I posted in #2 or #8.

If you wanted to test if A2 contained a letter from A to Z, and returned the corresponding number (i.e. A=1 and Z=26) with multiple IF statements, you could use:

=IF(A2="A",1,0)+IF(A2="B",2,0)+IF(A2="C",3,0)+...+IF(A2="Z",26,0)

Now let's put "D" in A2. All the IF statements return 0 except the IF(A2="D",4,0) one so the sum of all the IF statements will be 4. This is a way to "stack" 15 IF statements.
 
Upvote 0
Try what I posted in #2 or #8.

If you wanted to test if A2 contained a letter from A to Z, and returned the corresponding number (i.e. A=1 and Z=26) with multiple IF statements, you could use:

=IF(A2="A",1,0)+IF(A2="B",2,0)+IF(A2="C",3,0)+...+IF(A2="Z",26,0)

Now let's put "D" in A2. All the IF statements return 0 except the IF(A2="D",4,0) one so the sum of all the IF statements will be 4. This is a way to "stack" 15 IF statements.

We have 15 Models of machines and basically if a machine matches the list it returns a value after a calculation
 
Upvote 0
Let me be clear. The answer has already been posted.

Take this formula:

=(TODAY()-LOOKUP(A2,{"Compaq 2510p","Compaq 6730b","Compaq 6910p"},$K$2:$K$4))/365.25

After "Compaq 6910p", add your 12 other models with commas in between and speech marks. Change $K$4 to $K$16.
 
Upvote 0
Let me be clear. The answer has already been posted.

Take this formula:

=(TODAY()-LOOKUP(A2,{"Compaq 2510p","Compaq 6730b","Compaq 6910p"},$K$2:$K$4))/365.25

After "Compaq 6910p", add your 12 other models with commas in between and speech marks. Change $K$4 to $K$16.

WOW THAT WORKED :D thanks so much!!!!!
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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