help with super complex formula

Jyggalag

Active Member
Joined
Mar 8, 2021
Messages
445
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have a sheet called "Number of bank accounts". Here, in row 5, I have listed "Denmark" in cell C8, "Sweden" in cell C5, "Norway" in cell D8 and so on. In the respective cells underneath this, I want to have a formula that can take the name of the cell above it and look up the country above it (Denmark in the case of cell B9) in column E:E in my other sheet, which is called "Bank Accounts". I would like for this formula to count how many times Denmark, Sweden or any of the other countries appear in column E in the sheet Bank Accounts. However, I want to it to this based on the condition that the respective value in Column L in the sheet "Bank Accounts", for the country name in column E, contains a numeric value. If it does not contain a numeric value, or if the cell value is blank, I want the formula to ignore it and not count it I use ; as a separator, so please keep this in mind.

can anybody crack this code?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Please help the forum help you.

The forum needs to create your scenario manually, that takes time and can cause errors and typos, and wrong assumptions.

Please post a mini worksheet of your data and expected values using the xl2bb addin (link below)?
In a worst case post a table of data elements and expected values.
 
Upvote 0
here is a photo, please help:

1682945431089.png


i want the formula to return 3 for zimbabwe, 4 for USA and 2 for UK, since they have this amount of values each
 
Upvote 0
photos/images are not a lot of help. As we have no way of knowing what your actual data is.
Are the values in the value column numbers or formulas returning numbers?

I ask this because it seems you have formatted the column as "Accounting" but we have no idea. And Zimbabwee has 4 "Accounting" Values not 3.

Images are ambiguous.

Please post data, not images.
 
Upvote 0
sorry, here they are with the column and rows being visible:

1682946763010.png


and no zimbabwe has 3 values, which is cell I4, I5 and I15, the rest are not numerical values
 
Upvote 0
i asked for data not another image. Please help the forum help you!
 
Upvote 0
try
Excel Formula:
=sum(--(B4=$H$4:$H$18)*(--($I$4:$I$18>0))
 
Upvote 0
I guess just countifs will do the task - COUNTIFS(H4:H18,B4,I4:I18,">0")

_thanks
 
Upvote 0
I guess just countifs will do the task - COUNTIFS(H4:H18,B4,I4:I18,">0")

_thanks
i used this formula: COUNTIFS(H4:H18,B4,I4:I18,">0")

it works in my test sheet,

however in my real sheet it returns #VALUE for some reason, any idea why?

the values I am targeting (in what is I4:I18 above) in my real sheet are all formulas that pull in numbers, but even if I convert them to raw numbers, they still return #VALUE
 
Upvote 0
i used this formula: COUNTIFS(H4:H18,B4,I4:I18,">0")

it works in my test sheet,

however in my real sheet it returns #VALUE for some reason, any idea why?

the values I am targeting (in what is I4:I18 above) in my real sheet are all formulas that pull in numbers, but even if I convert them to raw numbers, they still return #VALUE
My guess is that you have non numbers in cells I4:I18.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

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