Include values of cells as an array in a formula ????

spydey

Active Member
Joined
Sep 19, 2017
Messages
314
Office Version
  1. 2013
Platform
  1. Windows
It has been a while since I posted.

I have a formula that references some values in a range. The range is static and the values are constant.

The formula is in cell E3.

I would like to remove the values from the range and hard code them into the formula so that I don't have to have the values visible in my data set.

Here is the formula, entered via CSE:

=IF(AND(F3:F6=0),"N/A",SUM(IF(D3:D6="N/A",0,D3:D6)*(C3:C6))/(100-SUM((D3:D6="N/A")*(C3:C6))))

The values are currently stored in the range C3:C6.

The values in vertical order are:

30
15
5
50

I tried to update the formula to the following (entered via CSE) but it does not give me the expected value.

=IF(AND(F3:F6=0),"N/A",SUM(IF(D3:D6="N/A",0,D3:D6)*{30,15,5,50})/(100-SUM((D3:D6="N/A")*{30,15,5,50})))

I have used similar formulas before and they work fine. I do not know why it does not want to calculate correctly.

Any pointers, ideas, thoughts, etc., are greatly appreciated.

-Spydey
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Does it work if you use semicolons instead of commas?

e.g. {30;15;5;50}
 
Upvote 0
Does it work if you use semicolons instead of commas?

e.g. {30;15;5;50}

All of my other formulas where I do something similar, and they work, do use semi-colons.

However, I will give it a try. (y)

Spydey
 
Upvote 0
Sorry, meant to say they do not use semi-colons.

-Spydey
 
Upvote 0
Ok, so I just tried it and it works now!!!

Interestingly, my other formulas all use commas, but they are referencing horizontal ranges.

Whereas this formula references a vertical range.

I wonder if there is a correlation between using semi-colons for vertical ranges and commas for horizontal ranges. Something I did not know before!!

Thanks @lrobbo314 for the heads up!! I appreciate it.

-Spydey
 
Upvote 0
No problemo.

You pretty much figured it out. When using arrays like this, commas act like delimiters for columns whereas semicolons act as row delimiters.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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