Countifs assigns same value to a cell when the value is different if there are mixed number and text cells in column

SimonTon

New Member
Joined
Mar 15, 2023
Messages
1
Office Version
  1. 2019
=IF($I6="","",IF($I6="Retired","",IF($I6="Current",COUNTIFS(PStatus,"Current",PVRN,"<="&$S6)+1,"")-1))

I have been using this formula to rank vehicle registrations alphabetically and this was working fine. I then used the same formula to rank plant items alphabetically. The plant items however either have a reg or a number rather than just a reg. The above formula will assign a text value the same number as one with a numerical value. Can anyone tell me why?

The below is not real data but an example of what is returned on the spreadsheet with the formula being in column B

A B
Identifier Rank
020 3
024 4
015 2
Test 2
003 1
Example 1

Why does the formula not rank the text after or before the numerical value?

I hope this makes sense and someone can help?

Cheers,

Simon
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi Simon,

your example data are in column A & B. Yet your formula acts on column I and S and named ranges PStatus and PVRN.

So difficult to explain for me what the formula does without knowing what's what
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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